Skip to content

Activeadmin v3 support#477

Merged
difernandez merged 4 commits into
masterfrom
activeadmin-v3-support
Aug 7, 2023
Merged

Activeadmin v3 support#477
difernandez merged 4 commits into
masterfrom
activeadmin-v3-support

Conversation

@difernandez

@difernandez difernandez commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

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.

@difernandez difernandez requested a review from ldlsegovia August 3, 2023 18:33
Comment thread spec/dummy/app/models/category.rb Outdated
Comment thread spec/dummy/app/models/category.rb Outdated
Comment thread spec/dummy/app/models/city.rb Outdated
Comment thread spec/dummy/app/models/city.rb Outdated
Comment thread spec/dummy/app/models/country.rb Outdated
Comment thread spec/dummy/app/models/invoice.rb Outdated
Comment thread spec/dummy/app/models/item.rb Outdated
Comment thread spec/dummy/app/models/item.rb Outdated
Comment thread spec/dummy/app/models/region.rb Outdated
Comment thread spec/dummy/app/models/region.rb Outdated
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
@difernandez difernandez force-pushed the activeadmin-v3-support branch from d838ab2 to faea79f Compare August 3, 2023 19:06
self.state ||= 'pending'
end

def self.ransackable_attributes(_auth_object = nil)

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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

@difernandez

Copy link
Copy Markdown
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
Copy Markdown
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