diff options
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/developer.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/models/developer.rb b/activerecord/test/models/developer.rb index c08476f728..1844014011 100644 --- a/activerecord/test/models/developer.rb +++ b/activerecord/test/models/developer.rb @@ -77,3 +77,15 @@ class DeveloperWithBeforeDestroyRaise < ActiveRecord::Base raise if projects.empty? end end + +class DeveloperOrderedBySalary < ActiveRecord::Base + self.table_name = 'developers' + default_scope :order => "salary DESC" + + def self.all_ordered_by_name + with_scope(:find => { :order => "name DESC" }) do + find(:all) + end + end + +end |