diff options
Diffstat (limited to 'activerecord/test/models/developer.rb')
-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..92039a4f54 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' + named_scope :by_name, :order => 'name DESC' + + def self.all_ordered_by_name + with_scope(:find => { :order => 'name DESC' }) do + find(:all) + end + end +end |