I like the type 2. But your example is a better candidate for named
scope.
like defining named scope 'active' and using like,
Post.active


On Jul 12, 5:37 pm, Rails List <[email protected]>
wrote:
> Recently I read that the following find
>
> Type 1
> ------
> Post.find(:first, :conditions => ['status = ? and active = ?', 1, 1])
>
> can be written as
>
> Type 2
> ------
> Post.find(:first, :conditions => { :status => 1, :active => 1 })
>
> But how do I include LIKE operator in Type 2 find?
>
> thanks
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to