aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/nested_attributes.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-05-25 15:58:16 +0100
committerJon Leighton <j@jonathanleighton.com>2012-06-15 19:15:36 +0100
commite030f26ad3de98205edec9d8b59ecca9508cb57d (patch)
treec57029efc255a81b6487803e02d2e38e0f0082b3 /activerecord/lib/active_record/nested_attributes.rb
parent61826bcca3481a85649be714a91a45ca909f2726 (diff)
downloadrails-e030f26ad3de98205edec9d8b59ecca9508cb57d.tar.gz
rails-e030f26ad3de98205edec9d8b59ecca9508cb57d.tar.bz2
rails-e030f26ad3de98205edec9d8b59ecca9508cb57d.zip
Simplify AR configuration code.
Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
Diffstat (limited to 'activerecord/lib/active_record/nested_attributes.rb')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb6
1 files changed, 5 insertions, 1 deletions
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