aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/member.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-01-26 23:00:13 +0000
committerJon Leighton <j@jonathanleighton.com>2011-01-30 11:58:09 +0000
commit3fa61ccb9eed0f17cdef85470ae708b4b09a3c06 (patch)
tree7f750e467a122891d248cbc0badb9ce485a37a51 /activerecord/test/models/member.rb
parentc5e912a8b38bc3555385e43a052a8d3eb0541ff3 (diff)
downloadrails-3fa61ccb9eed0f17cdef85470ae708b4b09a3c06.tar.gz
rails-3fa61ccb9eed0f17cdef85470ae708b4b09a3c06.tar.bz2
rails-3fa61ccb9eed0f17cdef85470ae708b4b09a3c06.zip
Has many through - It is not necessary to manually merge in the conditions hash for the through record, because the creation is done directly on the through association, which will already handle setting the conditions.
Diffstat (limited to 'activerecord/test/models/member.rb')
-rw-r--r--activerecord/test/models/member.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/models/member.rb b/activerecord/test/models/member.rb
index 15ad6aedd3..e6e78f9e45 100644
--- a/activerecord/test/models/member.rb
+++ b/activerecord/test/models/member.rb
@@ -13,4 +13,7 @@ class Member < ActiveRecord::Base
has_many :current_memberships
has_one :club_through_many, :through => :current_memberships, :source => :club
+
+ has_many :current_memberships, :conditions => { :favourite => true }
+ has_many :clubs, :through => :current_memberships
end