diff options
author | Matthew Draper <matthew@trebex.net> | 2017-10-10 07:10:37 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-10 07:10:37 +1030 |
commit | 1b36e2cc244d34f4f232ef5abecdf12731f5ccfd (patch) | |
tree | e0ddd5397fdc3fc97fdfe7c2e3208afeb9a5f6c0 /activerecord/lib | |
parent | 3564cd96045e62a7ea524f2f686c7a180badb6fa (diff) | |
parent | fb800feeea8b9cba38c8f616b8c7814e090b2905 (diff) | |
download | rails-1b36e2cc244d34f4f232ef5abecdf12731f5ccfd.tar.gz rails-1b36e2cc244d34f4f232ef5abecdf12731f5ccfd.tar.bz2 rails-1b36e2cc244d34f4f232ef5abecdf12731f5ccfd.zip |
Merge pull request #30836 from shioyama/generated_attribute_methods_include_mutex
Include Mutex_m into GeneratedAttributeMethods instead of extending instance
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index e4ca6c8408..891e556dc4 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -33,7 +33,9 @@ module ActiveRecord BLACKLISTED_CLASS_METHODS = %w(private public protected allocate new name parent superclass) - class GeneratedAttributeMethods < Module; end # :nodoc: + class GeneratedAttributeMethods < Module #:nodoc: + include Mutex_m + end module ClassMethods def inherited(child_class) #:nodoc: @@ -42,7 +44,7 @@ module ActiveRecord end def initialize_generated_modules # :nodoc: - @generated_attribute_methods = GeneratedAttributeMethods.new { extend Mutex_m } + @generated_attribute_methods = GeneratedAttributeMethods.new @attribute_methods_generated = false include @generated_attribute_methods |