Skip to content

Commit fc12655

Browse files
Remove extra class_eval for Ruby 1.9
1 parent 02a48fb commit fc12655

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

activesupport/lib/active_support/core_ext/module/attr_internal.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ def attr_internal_ivar_name(attr)
2727

2828
def attr_internal_define(attr_name, type)
2929
internal_name = attr_internal_ivar_name(attr_name).sub(/\A@/, '')
30-
# class_eval is necessary on 1.9 or else the methods are made private
31-
class_eval do
32-
# use native attr_* methods as they are faster on some Ruby implementations
33-
send("attr_#{type}", internal_name)
34-
end
30+
# use native attr_* methods as they are faster on some Ruby implementations
31+
send("attr_#{type}", internal_name)
3532
attr_name, internal_name = "#{attr_name}=", "#{internal_name}=" if type == :writer
3633
alias_method attr_name, internal_name
3734
remove_method internal_name

0 commit comments

Comments
 (0)