On Saturday, May 28, 2011 8:14:47 AM UTC-6, Erwin wrote:>
> In Rails 3 , it''s possible to write a query like
>
> account_type = AccountType.where(:membership_fees => 0; :locale =>
> {:code => I18n.locale}).first
> to find records when membership_fees == 0
> ( AccountType belongs to Locale)
>
> is it possible to write the same query for membership_fees >
> 0
>
> or should I write as in Rails 2 a pure condition ?
>
> Client.where("membership_fees > ? AND memberships.locale = ?",
0 ],
> I18n.locale)
>
> thanks for your feedback
I know this was posted some time ago (haven''t read this list is a
while) but
just in case you''re still interested...
I''d recommend you check out the meta_where gem:
https://github.com/ernie/meta_where
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/ZlN1NzFoMzZYZFVK.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.