Permalink
Browse files

Fix 'warning: method redefined' [#5551 state:resolved]

  • Loading branch information...
1 parent fb08e33 commit b73fe359a561699b01f786c28f812d4c0f2a683f @krekoten committed Sep 25, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb
@@ -21,10 +21,10 @@ class Module
def attr_accessor_with_default(sym, default = Proc.new)
define_method(sym, block_given? ? default : Proc.new { default })
module_eval(<<-EVAL, __FILE__, __LINE__ + 1)
- def #{sym}=(value) # def age=(value)
- class << self; attr_reader :#{sym} end # class << self; attr_reader :age end
- @#{sym} = value # @age = value
- end # end
+ def #{sym}=(value) # def age=(value)
+ class << self; attr_accessor :#{sym} end # class << self; attr_accessor :age end
+ @#{sym} = value # @age = value
+ end # end
EVAL
end
end

0 comments on commit b73fe35

Please sign in to comment.