From e030f26ad3de98205edec9d8b59ecca9508cb57d Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 25 May 2012 15:58:16 +0100 Subject: Simplify AR configuration code. Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc. --- activerecord/lib/active_record/nested_attributes.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/nested_attributes.rb') diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index 95a2ddcc11..841681e542 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -5,6 +5,11 @@ require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/class/attribute' module ActiveRecord + ActiveSupport.on_load(:active_record_config) do + mattr_accessor :nested_attributes_options, instance_accessor: false + self.nested_attributes_options = {} + end + module NestedAttributes #:nodoc: class TooManyRecords < ActiveRecordError end @@ -13,7 +18,6 @@ module ActiveRecord included do config_attribute :nested_attributes_options - self.nested_attributes_options = {} end # = Active Record Nested Attributes -- cgit v1.2.3