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

Activeadmin v3 support #477

Merged
merged 4 commits into from
Aug 7, 2023
Merged

Activeadmin v3 support #477

merged 4 commits into from
Aug 7, 2023

Conversation

difernandez
Copy link
Contributor

@difernandez difernandez commented Aug 3, 2023

Motivation / Background

This Pull Request has been created because ActiveAdmin released v3 🎉 . It has some breaking changes, including requiring of ransack v4, so some changes needed to be done on our part to support it.

Detail

This Pull Request applies a couple of backwards compatible changes that allow this gem to work well with AA v3, and for tests to pass using that version:

  • Adds ransackable_attributes and ransackable_associations to dummy app models, as it is now explicitly required by ransack v4
  • Removes some filter predicates (pretty much just contains), that are now removed from AA. These predicates were backports in AA, and they have been replaced by their already existent Ransack equivalents
  • Updates activeadmin version in Gemfile, to test and develop using v3

Additional information

Closes #475

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a concise description of what changed and why.
  • Tests are added or updated if you fix a bug or add a feature.
  • Documentation has been added or updated if you add a feature or modify an existing one.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature (under the "Unreleased" heading if this is not a version change).
  • My changes don't introduce any linter rule violations.

spec/dummy/app/models/category.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/category.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/city.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/city.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/country.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/invoice.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/item.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/item.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/region.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/region.rb Outdated Show resolved Hide resolved
Mainly, the 'contains' predicate, that was used as default in some components. These predicates were removed from activeadmin v3, since they were backports. More info here activeadmin/activeadmin#8010
@@ -92,4 +92,18 @@ def self.colors
def set_default_state
self.state ||= 'pending'
end

def self.ransackable_attributes(_auth_object = nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that now it is mandatory to do this, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@difernandez difernandez merged commit 87aa421 into master Aug 7, 2023
@difernandez difernandez deleted the activeadmin-v3-support branch August 7, 2023 19:43
@jgmontoya
Copy link
Contributor

Can we get a release of this before the whole v2 overhaul?

@difernandez
Copy link
Contributor Author

@jgmontoya even though we won't be backporting things to v1, this seems important enough that we can release it for a last v1 update. I opened #479 for this, so we should be releasing that in the short run

@difernandez
Copy link
Contributor Author

@jgmontoya we just released v1.10.1 , please let us know how it goes if you try it out

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

Successfully merging this pull request may close these issues.

ActiveAdmin version 3.0.0 released!
4 participants