aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/hotel.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-01-24 13:08:32 -0500
committerRafael França <rafaelmfranca@gmail.com>2016-01-24 13:08:32 -0500
commit5119171d3927a99b73809aa29e58e8866ad07110 (patch)
tree148d57924108c741e0a7ff7b5852338b8e6ffcd9 /activerecord/test/models/hotel.rb
parent6b89c4a24749ed972930ad1e27308bcda48c362b (diff)
parentb334bc93c6c3a37f69de9a130d43b8f1fda67e3c (diff)
downloadrails-5119171d3927a99b73809aa29e58e8866ad07110.tar.gz
rails-5119171d3927a99b73809aa29e58e8866ad07110.tar.bz2
rails-5119171d3927a99b73809aa29e58e8866ad07110.zip
Merge pull request #23221 from vipulnsward/23209-fix-missin_source_type
Add missing source_type if provided on hmt which belongs to an sti re…
Diffstat (limited to 'activerecord/test/models/hotel.rb')
-rw-r--r--activerecord/test/models/hotel.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/models/hotel.rb b/activerecord/test/models/hotel.rb
index 491f8dfde3..9c90ffcff4 100644
--- a/activerecord/test/models/hotel.rb
+++ b/activerecord/test/models/hotel.rb
@@ -3,5 +3,9 @@ class Hotel < ActiveRecord::Base
has_many :chefs, through: :departments
has_many :cake_designers, source_type: 'CakeDesigner', source: :employable, through: :chefs
has_many :drink_designers, source_type: 'DrinkDesigner', source: :employable, through: :chefs
+
+ has_many :chef_lists, as: :employable_list
+ has_many :mocktail_designers, through: :chef_lists, source: :employable, :source_type => "MocktailDesigner"
+
has_many :recipes, through: :chefs
end