Set the create scope to an empty hash in ThroughAssociationScope. For reasoning please see the inline code comments.

This commit is contained in:
Jon Leighton 2010-12-23 20:41:20 +00:00
parent ac67eee4e6
commit 93861d19e3
1 changed files with 5 additions and 1 deletions

View File

@ -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