Q:

ruby activerecord easy one: call attribute by variable

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! 

A:

def increment_attribute(name)
  self.send(name).increment
end

