Fix when assigning nested attributes raises "undefined method `to_sym' for nil:NilClass"

Posted . Visible to the public.

You might have a table without a primary key set in MySQL.

You can fix this by adding a primary key index to the guilty MySQL table, or by setting self.primary_key = "id" in your class definition.

Related, but different issue: Rails 2 does not find an association when it is named with a string instead of a symbol

Henning Koch
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2014-03-05 14:29)