diff options
author | Jon Leighton <j@jonathanleighton.com> | 2013-01-18 12:30:47 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2013-01-18 12:30:47 +0000 |
commit | 5937bd02dee112646469848d7fe8a8bfcef5b4c1 (patch) | |
tree | 9406b572ea9d9fadcfabca94084834e1188f8c25 /activerecord/test/models | |
parent | 5f759ff063b8ed054cdde0ed4f3593ef89fe59b7 (diff) | |
download | rails-5937bd02dee112646469848d7fe8a8bfcef5b4c1.tar.gz rails-5937bd02dee112646469848d7fe8a8bfcef5b4c1.tar.bz2 rails-5937bd02dee112646469848d7fe8a8bfcef5b4c1.zip |
Undeprecate the :extend option
Suggested by @dhh.
It doesn't affect the generated SQL, so seems reasonable to continue to
allow it as an association option.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/post.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index c995f59a15..4433550dd5 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -5,6 +5,12 @@ class Post < ActiveRecord::Base end end + module NamedExtension2 + def greeting + "hello" + end + end + scope :containing_the_letter_a, -> { where("body LIKE '%a%'") } scope :ranked_by_comments, -> { order("comments_count DESC") } @@ -43,6 +49,14 @@ class Post < ActiveRecord::Base end end + has_many :comments_with_extend, extend: NamedExtension, class_name: "Comment", foreign_key: "post_id" do + def greeting + "hello" + end + end + + has_many :comments_with_extend_2, extend: [NamedExtension, NamedExtension2], class_name: "Comment", foreign_key: "post_id" + has_many :author_favorites, :through => :author has_many :author_categorizations, :through => :author, :source => :categorizations has_many :author_addresses, :through => :author |