In order to turn a setter that ActiveRecord generates for you, the following pattern can be used:
class ParentModel def name=(name) @attributes ||= {}