aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/car.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/car.rb')
-rw-r--r--activerecord/test/models/car.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/test/models/car.rb b/activerecord/test/models/car.rb
index a1e351b54e..e7db3d3423 100644
--- a/activerecord/test/models/car.rb
+++ b/activerecord/test/models/car.rb
@@ -1,4 +1,5 @@
class Car < ActiveRecord::Base
+
has_many :bulbs
has_many :tyres
has_many :engines
@@ -7,9 +8,15 @@ class Car < ActiveRecord::Base
scope :incl_tyres, includes(:tyres)
scope :incl_engines, includes(:engines)
- default_scope :order => 'name desc'
-
scope :order_using_new_style, order('name asc')
scope :order_using_old_style, :order => 'name asc'
end
+
+class CoolCar < Car
+ default_scope :order => 'name desc'
+end
+
+class FastCar < Car
+ default_scope order('name desc')
+end