Typically, when one creates a has_many associated table one does this:
hasone.hasmany.build({attribute hash},{attribute hash},…} or
hasone.hasmany.create({attribute hash}, …
However, if mass assignment is turned off (attr_accessible => nil), then
I cannot seem to set the attributes directly.
For example, in a console session I do this:
me = Entity.new
=> …me.attribute = …
…me.save!
=> truemi = me.identifiers.build
=> …mi.entity_id
=> 1mi.identifier_type = ‘post’
=> ‘post’mi.identifier_type
=> nil
What is going on and how do I directly set association attributes?