diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-07-13 19:34:40 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-07-20 14:14:51 +0100 |
commit | e1cfa6e0705f37b5f8cb885380f3a47405c24a9d (patch) | |
tree | c861793bab863a5fd227c4b87a8a689dddec5bd6 /activerecord/test/models/member.rb | |
parent | 7a271a8e844a4a5c931652a4a33a0d27445137c0 (diff) | |
download | rails-e1cfa6e0705f37b5f8cb885380f3a47405c24a9d.tar.gz rails-e1cfa6e0705f37b5f8cb885380f3a47405c24a9d.tar.bz2 rails-e1cfa6e0705f37b5f8cb885380f3a47405c24a9d.zip |
Convert association macros to the new syntax
Diffstat (limited to 'activerecord/test/models/member.rb')
-rw-r--r-- | activerecord/test/models/member.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/models/member.rb b/activerecord/test/models/member.rb index 1f719b0858..359b29fac3 100644 --- a/activerecord/test/models/member.rb +++ b/activerecord/test/models/member.rb @@ -5,8 +5,8 @@ class Member < ActiveRecord::Base has_many :fellow_members, :through => :club, :source => :members has_one :club, :through => :current_membership has_one :selected_club, :through => :selected_membership, :source => :club - has_one :favourite_club, :through => :membership, :conditions => ["memberships.favourite = ?", true], :source => :club - has_one :hairy_club, :through => :membership, :conditions => {:clubs => {:name => "Moustache and Eyebrow Fancier Club"}}, :source => :club + has_one :favourite_club, -> { where "memberships.favourite = ?", true }, :through => :membership, :source => :club + has_one :hairy_club, -> { where :clubs => {:name => "Moustache and Eyebrow Fancier Club"} }, :through => :membership, :source => :club has_one :sponsor, :as => :sponsorable has_one :sponsor_club, :through => :sponsor has_one :member_detail @@ -27,7 +27,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 :current_memberships, -> { where :favourite => true } has_many :clubs, :through => :current_memberships end |