DmitryTsepelev/store_model

Error after update to Rails 7.2

timfsw opened this issue · 0 comments

After updating to Rails 7.2, I now get the following error message:

NameError: undefined local variable or method `attributes_to_define_after_schema_loads' for class AnnouncementFilter (NameError)
Did you mean?  attribute_methods_generated?

The following fix currently works for me:

StoreModel::NestedAttributes::ClassMethods.class_eval do
  private

  def nested_attribute_type(attribute)
    # if self < ActiveRecord::Base && !schema_loaded?
    #   attributes_to_define_after_schema_loads[attribute.to_s]&.first
    # else
    #   attribute_types[attribute.to_s]
    # end

    attribute_types[attribute.to_s]
  end
end

Versions:

  • ruby: 3.3.4
  • rails: 7.2.0
  • store_model: 3.0.2