Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after update to Rails 7.2 #179

Closed
timfsw opened this issue Aug 12, 2024 · 0 comments · Fixed by #182
Closed

Error after update to Rails 7.2 #179

timfsw opened this issue Aug 12, 2024 · 0 comments · Fixed by #182

Comments

@timfsw
Copy link

timfsw commented Aug 12, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant