Is there a more elegant way to do this:
widget.notes.where(:author_id => a).first.message= widget.notes.where(:author_id => a).first.message << "Potato"
For example, the following do not work:
widget.notes.where(:author_id => a).first.message << "Potato"
widget.notes.where(:author_id => a).first.message <<! "Potato"
Respectively not modifying, or returning an error (as there is no
<<!
operator)
key: widget is an instance of Widget. Widgets can have notes. Notes have an attr_accessible for :message. 'a' is just a user instance.