diff options
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 80b7658a95..d3b76e2087 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -86,14 +86,14 @@ module ActiveRecord end def create(attrs = {}) - record = @reflection.klass.with_scope(construct_scope) { @reflection.klass.create(attrs) } + record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create(attrs) } @target ||= [] unless loaded? @target << record record end def create!(attrs = {}) - record = @reflection.klass.with_scope(construct_scope) { @reflection.klass.create!(attrs) } + record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create!(attrs) } @target ||= [] unless loaded? @target << record record diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index 9beddb2ac9..bb541152c1 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -7,7 +7,7 @@ module ActiveRecord end def create(attrs = {}, replace_existing = true) - record = @reflection.klass.with_scope(construct_scope) { @reflection.klass.create(attrs) } + record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create(attrs) } if replace_existing replace(record, true) @@ -20,7 +20,7 @@ module ActiveRecord end def create!(attrs = {}, replace_existing = true) - record = @reflection.klass.with_scope(construct_scope) { @reflection.klass.create!(attrs) } + record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create!(attrs) } if replace_existing replace(record, true) |