I changed my answer after @keithepley comment
#Post.find(:all, :conditions => { :approved => true }) Post.where(:approved => true).all #Post.find(:first, :conditions => { :approved => true }) Post.where(:approved => true).first or post = Post.first or post = Post.first! or post = Post.last or post = Post.last!
You can learn more from these locations.
outdated operator
Post.find(:all, :conditions => { :approved => true })
best version
Post.all(:conditions => { :approved => true })
best version (1)
named_scope :approved, :conditions => { :approved => true } Post.approved.all
best version (2)
Post.scoped(:conditions => { :approved => true }).all
Strike>
source share