Hello,
I just learned that Arel support more powerful queries than in rails, e.g.
users = Arel::Table.new('users')
users.where( (users[:id].eq(1)).or(users[:id].eq(2)) )
In rails it will be
User.where( (User.arel_table[:id].eq(1)).or(User.arel_table[:id].eq(2))) )
Which is too complex. DAE think it's a good to have a convinient way to
express above query in rails? maybe like this:
User.where(:id.eq(1).or.(:id.eq(2)))
or
User.where(:id => 1).or.where(:id => 2)
?
Or such a way already exists? If no, why not?
Regards
Jan
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.