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

Incompatibility with attribute grouping (Administrate 0.20.0) #65

Closed
CharlotteBory opened this issue Jan 18, 2024 · 2 comments · Fixed by #79
Closed

Incompatibility with attribute grouping (Administrate 0.20.0) #65

CharlotteBory opened this issue Jan 18, 2024 · 2 comments · Fixed by #79

Comments

@CharlotteBory
Copy link

The latest version of Administrate groups attributes.
The return value for Field#attributes is now a Hash {"Group title" => [Field, Field]} rather than an Array [Field, Field]. This is incompatible with the current version, throwing Undefined method 'attributes' for "":String (NoMethodError) where "" is the group title.

This is where the error is first raised:

# lib/administrate/field/nested_has_many.rb

  def nested_fields
    associated_form.attributes.reject do |nested_field|
      skipped_fields.include?(nested_field.attribute)
    end
  end

I may be able to make a PR to handle the new format but in the meantime I wanted to document my findings.

@nickcharlton
Copy link
Owner

Oh, dammit! Thanks for noticing that and opening this.

If you could try with a PR, that'd be great! Let me know if you need any help.

nickcharlton added a commit that referenced this issue Jan 25, 2024
0.20.0 introduces a change relating to attribute grouping and makes it
incompatible. We'll pin this here and release a new version with this
change so that a future breaking change can be marked as such.

#65
nickcharlton added a commit that referenced this issue Jan 25, 2024
0.20.0 introduces a change relating to attribute grouping and makes it
incompatible. We'll pin this here and release a new version with this
change so that a future breaking change can be marked as such.

#65
nickcharlton pushed a commit to trevorrjohn/administrate-field-nested_has_many that referenced this issue Jan 25, 2024
In Administrate v0.20.0, support was added for grouping fields but this
was not compatible with this field type.

thoughtbot/administrate#2422

Fixes nickcharlton#65
trevorrjohn added a commit to trevorrjohn/administrate-field-nested_has_many that referenced this issue Jan 26, 2024
In Administrate v0.20.0, support was added for grouping fields but this
was not compatible with this field type.

thoughtbot/administrate#2422

Fixes nickcharlton#65
@gustavosobral
Copy link

We just updated to administrate v0.20 and noticed the same issue. Looking forward for the #66 fix 🙇

trevorrjohn added a commit to trevorrjohn/administrate-field-nested_has_many that referenced this issue Feb 5, 2024
In Administrate v0.20.0, support was added for grouping fields but this
was not compatible with this field type.

thoughtbot/administrate#2422

Fixes nickcharlton#65
trevorrjohn added a commit to trevorrjohn/administrate-field-nested_has_many that referenced this issue Feb 8, 2024
In Administrate v0.20.0, support was added for grouping fields but this
was not compatible with this field type.

thoughtbot/administrate#2422

Fixes nickcharlton#65
nickcharlton pushed a commit that referenced this issue Feb 14, 2024
In Administrate v0.20.0, support was added for grouping fields but this
was not compatible with this field type.

thoughtbot/administrate#2422

Fixes #65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants