Reputation: 3869
I want to update an attribute defined by a variable in an activerecord model.
This is my method
def increment_attribute(attr_name)
self.attribute(attr_name).increment
end
This doesn't work because attribute is a private activerecord method
How should I do this? Thanks!
Upvotes: 1
Views: 246