Displaying 1 result from an estimated 1 matches for "find_all_marked".
2008 Apr 04
0
named_scope and ordering
Hi,
this is a general design question and I liked to see how other people
handle the following situation: Before named_scope I wrote custom
finders for my model classes. Something like
# order.rb
class Order < ActiveRecord::Base
  class << self
    def find_all_marked
      find(:all, :conditions => {:marked => 1}, :order => ''name ASC'')
    end
  end
end
Now this can easily be refactored to
class Order < ActiveRecord::Base
  named_scope :marked, :conditions => {:marked => 1}, :order => ''name
ASC''
end
Wh...