aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/sponsor.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:37:57 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:37:57 +0200
commitd22e522179c1c90e658c3ed0e9b972ec62306209 (patch)
tree3ccbdff567b79a128ad61adcbb4f2950ca9b696e /activerecord/test/models/sponsor.rb
parentfa911a74e15ef34bb435812f7d9cf7324253476f (diff)
downloadrails-d22e522179c1c90e658c3ed0e9b972ec62306209.tar.gz
rails-d22e522179c1c90e658c3ed0e9b972ec62306209.tar.bz2
rails-d22e522179c1c90e658c3ed0e9b972ec62306209.zip
modernizes hash syntax in activerecord
Diffstat (limited to 'activerecord/test/models/sponsor.rb')
-rw-r--r--activerecord/test/models/sponsor.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/models/sponsor.rb b/activerecord/test/models/sponsor.rb
index 5f7e47b583..175933ccf1 100644
--- a/activerecord/test/models/sponsor.rb
+++ b/activerecord/test/models/sponsor.rb
@@ -1,7 +1,7 @@
class Sponsor < ActiveRecord::Base
- belongs_to :sponsor_club, :class_name => "Club", :foreign_key => "club_id"
- belongs_to :sponsorable, :polymorphic => true
- belongs_to :thing, :polymorphic => true, :foreign_type => :sponsorable_type, :foreign_key => :sponsorable_id
- belongs_to :sponsorable_with_conditions, -> { where :name => "Ernie"}, :polymorphic => true,
- :foreign_type => "sponsorable_type", :foreign_key => "sponsorable_id"
+ belongs_to :sponsor_club, class_name: "Club", foreign_key: "club_id"
+ belongs_to :sponsorable, polymorphic: true
+ belongs_to :thing, polymorphic: true, foreign_type: :sponsorable_type, foreign_key: :sponsorable_id
+ belongs_to :sponsorable_with_conditions, -> { where name: "Ernie"}, polymorphic: true,
+ foreign_type: "sponsorable_type", foreign_key: "sponsorable_id"
end