mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
It's not needed to initialize the attr when calling mattr_writer
This commit is contained in:
committed by
Aaron Patterson
parent
7aec9f9c02
commit
cebe5c2fac
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user