diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-07-18 04:55:59 +0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-18 06:06:58 +0800 |
commit | cebe5c2fac708885c018550f7ef4610df613e5af (patch) | |
tree | 9d484a32e29562c29f0f1d8c3e7eacc7a52f36e7 /activesupport/lib/active_support/core_ext | |
parent | 7aec9f9c028dd7b53f2a389d2d8bd7d27a770461 (diff) | |
download | rails-cebe5c2fac708885c018550f7ef4610df613e5af.tar.gz rails-cebe5c2fac708885c018550f7ef4610df613e5af.tar.bz2 rails-cebe5c2fac708885c018550f7ef4610df613e5af.zip |
It's not needed to initialize the attr when calling mattr_writer
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/attribute_accessors.rb | 8 |
1 files changed, 1 insertions, 7 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 9c4d5fae26..2d88cb57e5 100644 --- a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +++ b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb @@ -5,9 +5,7 @@ class Module options = syms.extract_options! syms.each do |sym| class_eval(<<-EOS, __FILE__, __LINE__ + 1) - unless defined? @@#{sym} - @@#{sym} = nil - end + @@#{sym} = nil unless defined? @@#{sym} def self.#{sym} @@#{sym} @@ -28,10 +26,6 @@ class Module options = syms.extract_options! syms.each do |sym| class_eval(<<-EOS, __FILE__, __LINE__ + 1) - unless defined? @@#{sym} - @@#{sym} = nil - end - def self.#{sym}=(obj) @@#{sym} = obj end |