aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/class/attribute.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/class/attribute.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/class/attribute.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb
index d2bcd7a778..576366e496 100644
--- a/activesupport/lib/active_support/core_ext/class/attribute.rb
+++ b/activesupport/lib/active_support/core_ext/class/attribute.rb
@@ -61,10 +61,7 @@ class Class
end
RUBY
- if instance_writer
- body = "def #{name}=(value) @#{name} = value end"
- class_eval body, __FILE__, __LINE__ - 1
- end
+ attr_writer name if instance_writer
end
end
end