aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorLachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au>2015-08-07 20:05:02 +1000
committerLachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au>2015-08-07 20:05:02 +1000
commita51dad1c525c674ba9e08697332f86790e3570ca (patch)
treebeb481e05e5772d2a188938ca535d0dcd2beb534 /activesupport/lib
parent4b91db5b125dd7bd735e7f42eb8e2c14c0e6757e (diff)
downloadrails-a51dad1c525c674ba9e08697332f86790e3570ca.tar.gz
rails-a51dad1c525c674ba9e08697332f86790e3570ca.tar.bz2
rails-a51dad1c525c674ba9e08697332f86790e3570ca.zip
Only invoke the default block for mattr_accessor once so that it does not cause issues if it is not idempotent
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/module/attribute_accessors.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
index d4e6b5a1ac..a77da573fe 100644
--- a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
+++ b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
@@ -206,7 +206,7 @@ class Module
# Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red]
def mattr_accessor(*syms, &blk)
mattr_reader(*syms, &blk)
- mattr_writer(*syms, &blk)
+ mattr_writer(*syms)
end
alias :cattr_accessor :mattr_accessor
end