aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/club.rb
diff options
context:
space:
mode:
authorNat Budin <nbudin@patientslikeme.com>2014-06-17 10:11:22 -0700
committerNat Budin <nbudin@patientslikeme.com>2014-06-17 10:15:04 -0700
commit30b76e5575c57056361741ebbede972f8ef477de (patch)
treeb6c0b24bc6e1242ca8170f46c8223d1537171ebd /activerecord/test/models/club.rb
parent0c2fbc509545612908dd7bbdde3221518a2ec0e1 (diff)
downloadrails-30b76e5575c57056361741ebbede972f8ef477de.tar.gz
rails-30b76e5575c57056361741ebbede972f8ef477de.tar.bz2
rails-30b76e5575c57056361741ebbede972f8ef477de.zip
Don't include inheritance column in the through_scope_attributes
Diffstat (limited to 'activerecord/test/models/club.rb')
-rw-r--r--activerecord/test/models/club.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/models/club.rb b/activerecord/test/models/club.rb
index a762ad4bb5..b260b6458a 100644
--- a/activerecord/test/models/club.rb
+++ b/activerecord/test/models/club.rb
@@ -5,7 +5,7 @@ class Club < ActiveRecord::Base
has_one :sponsor
has_one :sponsored_member, :through => :sponsor, :source => :sponsorable, :source_type => "Member"
belongs_to :category
-
+
has_many :favourites, -> { where(memberships: { favourite: true }) }, through: :memberships, source: :member
private
@@ -14,3 +14,10 @@ class Club < ActiveRecord::Base
"I'm sorry sir, this is a *private* club, not a *pirate* club"
end
end
+
+class SuperClub < ActiveRecord::Base
+ self.table_name = "clubs"
+
+ has_many :memberships, :class_name => "SuperMembership", :foreign_key => "club_id"
+ has_many :members, :through => :memberships
+end \ No newline at end of file