From 9994f0d90248db7d7eae36f0b597a15e8a427612 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Wed, 10 Sep 2008 18:50:01 +0100 Subject: Revert "Add :accessible option to Associations for allowing mass assignments using hash. [#474 state:resolved]" This reverts commit e0750d6a5c7f621e4ca12205137c0b135cab444a. Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/association_collection.rb --- .../lib/active_record/associations/association_collection.rb | 6 ------ 1 file changed, 6 deletions(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index d4bb43970f..8de528f638 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -110,8 +110,6 @@ module ActiveRecord @owner.transaction do flatten_deeper(records).each do |record| - record = @reflection.build_association(record) if @reflection.options[:accessible] && record.is_a?(Hash) - raise_on_type_mismatch(record) add_record_to_target_with_callbacks(record) do |r| result &&= insert_record(record) unless @owner.new_record? @@ -286,10 +284,6 @@ module ActiveRecord # Replace this collection with +other_array+ # This will perform a diff and delete/add only records that have changed. def replace(other_array) - other_array.map! do |val| - val.is_a?(Hash) ? @reflection.build_association(val) : val - end if @reflection.options[:accessible] - other_array.each { |val| raise_on_type_mismatch(val) } load_target -- cgit v1.2.3