I was running into the new_record?/nil class issue described in the readme.
undefined method `new_record?' for nil:NilClass
is_dynamic = f.object.new_record?
^^^^^^^^^^^^
I have my models listed in a namespace, and had to apply this fix to get them to work with Administrate. For nested_has_many, the Administrate fix wasn't enough and I had to also add the class_name to the field options:
ATTRIBUTE_TYPES = {
country_tax_note: Field::NestedHasMany.with_options(class_name: "ColaCom::CountryTaxNote", skip: :tax_country),
tax_state: Field::HasMany,
...
...
I tried adding the appropriate accepts_nested_attributes_for lines in my ColaCom::TaxCountry model
has_many :country_tax_note, dependent: :destroy
has_many :tax_state, dependent: :destroy
accepts_nested_attributes_for :country_tax_note, reject_if: :all_blank, allow_destroy: true
accepts_nested_attributes_for :tax_state, reject_if: :all_blank, allow_destroy: true
...
...
but I still get this error. Is there any way to debug exactly which nested attribute I'm missing?
I was running into the new_record?/nil class issue described in the readme.
I have my models listed in a namespace, and had to apply this fix to get them to work with Administrate. For
nested_has_many, the Administrate fix wasn't enough and I had to also add theclass_nameto the field options:I tried adding the appropriate
accepts_nested_attributes_forlines in myColaCom::TaxCountrymodelbut I still get this error. Is there any way to debug exactly which nested attribute I'm missing?