"import" throws warnings like the following when trying to set
protected attributes:
WARNING: Can't mass-assign these protected attributes: id
This has been reported as part of the issue in other tickets
such as in #13 Imports with default primary key breaking
It looks like this is due to the way ar-extensions builds the
model instances, with new(), in order to run validations. Rails
throws the warnings and removes the protected attributes from the
instances, and so they are never imported.
This is reasonable behavior in some sense, but you (or at least
I) may want to set protected attributes in some scenarios. I
committed a patch that allows this behavior through the use of a
:write_protected_attrs option.
Github commit
The code is essentially just preempting the
remove_attributes_protected_from_mass_assignment() call in
active_record/base.rb.