I have an ActiveRecord class – lets call it comments – which has an author attribute.
In my code at one point I have passed an instance of comments and the symbol :author to a helper method. I now find myself wanting to access the author attribute and was wondering if there’s a way of doing this with what I have.
I can use comment.read_attribute :author but I can’t use comment.write_attribute :author as it is a private method.
I suspect I’m missing something quite obvious. Any ideas?
You can use
instance_evalor