On 15 March 2010 10:47, M I R <m.irfansb@gmail.com> wrote:
> select * from abc where id=1 and type = 'a'
>
> how will i do if:
>
> find_by_id(id) >>>>> how will i use for multiple conditions
Model.all(:conditions => ["id = ? AND type = ?", id, type])
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002263
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment