mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
cd9592959f
Currently `scope_chain` uses same array for building different `scope_chain` for different associations. During processing these arrays are sometimes mutated and because of in-place mutation the changed `scope_chain` impacts other reflections. Fix is to dup the value before adding to the `scope_chain`. Fixes #3882.
6 lines
292 B
Ruby
6 lines
292 B
Ruby
class Hotel < ActiveRecord::Base
|
|
has_many :departments
|
|
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
|
|
end
|