From cebe5c2fac708885c018550f7ef4610df613e5af Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 18 Jul 2010 04:55:59 +0800 Subject: It's not needed to initialize the attr when calling mattr_writer --- .../lib/active_support/core_ext/module/attribute_accessors.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/module') 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 -- cgit v1.2.3