Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix when database column name has some symbolic characters. [#5818 st…

…ate:resolved]
  • Loading branch information...
commit 88688cdd8e467d4bdebfa3f08e47cd5e7c5ead2c 1 parent e6d1427
Robert Pankowecki paneq authored josevalim committed
Showing with 5 additions and 5 deletions.
  1. +5 −5 activemodel/lib/active_model/attribute_methods.rb
10 activemodel/lib/active_model/attribute_methods.rb
View
@@ -98,10 +98,10 @@ module ClassMethods
def define_attr_method(name, value=nil, &block)
sing = singleton_class
sing.class_eval <<-eorb, __FILE__, __LINE__ + 1
- if method_defined?(:original_#{name})
- undef :original_#{name}
+ if method_defined?(:'original_#{name}')
+ undef :'original_#{name}'
end
- alias_method :original_#{name}, :#{name}
+ alias_method :'original_#{name}', :'#{name}'
eorb
if block_given?
sing.send :define_method, name, &block
@@ -274,8 +274,8 @@ def define_attribute_methods(attr_names)
method_name = matcher.method_name(attr_name)
generated_attribute_methods.module_eval <<-STR, __FILE__, __LINE__ + 1
- if method_defined?(:#{method_name})
- undef :#{method_name}
+ if method_defined?(:'#{method_name}')
+ undef :'#{method_name}'
end
def #{method_name}(*args)
send(:#{matcher.method_missing_target}, '#{attr_name}', *args)
Please sign in to comment.
Something went wrong with that request. Please try again.