diff options
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/car.rb | 4 | ||||
-rw-r--r-- | activerecord/test/models/engine.rb | 3 | ||||
-rw-r--r-- | activerecord/test/models/wheel.rb | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/models/car.rb b/activerecord/test/models/car.rb new file mode 100644 index 0000000000..1101180a67 --- /dev/null +++ b/activerecord/test/models/car.rb @@ -0,0 +1,4 @@ +class Car < ActiveRecord::Base + has_many :engines + has_many :wheels, :as => :wheelable +end diff --git a/activerecord/test/models/engine.rb b/activerecord/test/models/engine.rb new file mode 100644 index 0000000000..751c3f02d1 --- /dev/null +++ b/activerecord/test/models/engine.rb @@ -0,0 +1,3 @@ +class Engine < ActiveRecord::Base + belongs_to :my_car, :class_name => 'Car', :foreign_key => 'car_id', :counter_cache => :engines_count +end diff --git a/activerecord/test/models/wheel.rb b/activerecord/test/models/wheel.rb new file mode 100644 index 0000000000..26868bce5e --- /dev/null +++ b/activerecord/test/models/wheel.rb @@ -0,0 +1,3 @@ +class Wheel < ActiveRecord::Base + belongs_to :wheelable, :polymorphic => true, :counter_cache => true +end |