mirror of https://github.com/rails/rails
Set the create scope to an empty hash in ThroughAssociationScope. For reasoning please see the inline code comments.
This commit is contained in:
parent
ac67eee4e6
commit
93861d19e3
|
@ -35,8 +35,12 @@ module ActiveRecord
|
|||
}
|
||||
end
|
||||
|
||||
# This scope affects the creation of the associated records (not the join records). At the
|
||||
# moment we only support creating on a :through association when the source reflection is a
|
||||
# belongs_to. Thus it's not necessary to set a foreign key on the associated record(s), so
|
||||
# this scope has can legitimately be empty.
|
||||
def construct_create_scope
|
||||
construct_owner_attributes(@reflection)
|
||||
{ }
|
||||
end
|
||||
|
||||
def aliased_through_table
|
||||
|
|
Loading…
Reference in New Issue