diff options
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/author.rb | 3 | ||||
-rw-r--r-- | activerecord/test/models/car.rb | 5 | ||||
-rw-r--r-- | activerecord/test/models/tyre.rb | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index 727978431c..34bfd2d881 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -93,6 +93,9 @@ class Author < ActiveRecord::Base belongs_to :author_address, :dependent => :destroy belongs_to :author_address_extra, :dependent => :delete, :class_name => "AuthorAddress" + scope :relation_include_posts, includes(:posts) + scope :relation_include_tags, includes(:tags) + attr_accessor :post_log after_initialize :set_post_log diff --git a/activerecord/test/models/car.rb b/activerecord/test/models/car.rb index 1101180a67..faf4e6cbc0 100644 --- a/activerecord/test/models/car.rb +++ b/activerecord/test/models/car.rb @@ -1,4 +1,9 @@ class Car < ActiveRecord::Base + has_many :tyres has_many :engines has_many :wheels, :as => :wheelable + + scope :incl_tyres, includes(:tyres) + scope :incl_engines, includes(:engines) + end diff --git a/activerecord/test/models/tyre.rb b/activerecord/test/models/tyre.rb new file mode 100644 index 0000000000..bc3444aa7d --- /dev/null +++ b/activerecord/test/models/tyre.rb @@ -0,0 +1,3 @@ +class Tyre < ActiveRecord::Base + belongs_to :car +end |