Skip to content

Conversation

javierjulio
Copy link
Member

@javierjulio javierjulio commented Jul 11, 2023

This removes backports for a gem (MetaSearch) that was deprecated in favor of Ransack over a decade ago. We want to reduce our footprint and just rely on Ransack's defaults and docs. This will be part of a major ActiveAdmin release since it's a breaking change alongside #8009. Closes #3511

Required changes to update:

Any filters or hard coded URL paths using filter parameters that use the predicates listed below on the left, now have to be replaced with the value on the right:

  • _equals -> _eq
  • _contains -> _cont
  • _starts_with -> _start
  • _ends_with -> _end
  • _greater_than -> _gt
  • _less_than -> _lt
  • _gteq_datetime -> _gteq
  • _lteq_datetime -> _lteq

Behavioral changes

When filtering by range with a datetime column (e.g. created_at), a custom predicate would modify the "to" value so it was always a day after in the generated database query. So if the "from" and "to" filters had the same supplied date, e.g. 2023-07-11, the query would query data in a 24 hour range.

Now that the custom predicate is removed that behavior is not present. To achieve a similar result with this change, the supplied "to" filter value has to be the next day. So going with the earlier example, the "from" is 2023-07-11 and the "to" would now have to be 2023-07-12 instead.

@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.05 🎉

Comparison is base (c3a2dfd) 99.09% compared to head (9145186) 99.14%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8010      +/-   ##
==========================================
+ Coverage   99.09%   99.14%   +0.05%     
==========================================
  Files         197      196       -1     
  Lines        4949     4939      -10     
==========================================
- Hits         4904     4897       -7     
+ Misses         45       42       -3     
Impacted Files Coverage Δ
lib/active_admin.rb 100.00% <ø> (ø)
lib/active_admin/filters/active_filter.rb 100.00% <ø> (ø)
lib/active_admin/filters/forms.rb 100.00% <100.00%> (ø)
..._admin/inputs/filters/base/search_method_select.rb 100.00% <100.00%> (ø)
...ib/active_admin/inputs/filters/date_range_input.rb 100.00% <100.00%> (ø)
lib/active_admin/inputs/filters/numeric_input.rb 100.00% <100.00%> (ø)
lib/active_admin/inputs/filters/string_input.rb 100.00% <100.00%> (ø)
lib/active_admin/namespace_settings.rb 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@javierjulio javierjulio changed the title Remove MetaSearch backports & use Ransack defaults Remove custom Ransack predicates which were MetaSearch backports Jul 11, 2023
@javierjulio javierjulio changed the title Remove custom Ransack predicates which were MetaSearch backports Remove custom Ransack predicates that were MetaSearch backports Jul 11, 2023
@javierjulio javierjulio force-pushed the remove-metasearch-backports branch from 0a3b904 to 0b7803b Compare July 12, 2023 00:09
This closes #3511 and is updated branch with no merge conflicts. Instead of fixing each conflict, since the original PR is very old, started from scratch making each change and running the tests.

This removes backports for a gem that was deprecated in favor of ransack. We want to reduce our footprint and just rely on ransack's defaults and docs.
@javierjulio javierjulio force-pushed the remove-metasearch-backports branch from 0b7803b to 9145186 Compare July 12, 2023 23:55
@javierjulio javierjulio merged commit 6333cfc into master Jul 13, 2023
@javierjulio javierjulio deleted the remove-metasearch-backports branch July 13, 2023 00:02
difernandez added a commit to platanus/activeadmin_addons that referenced this pull request Aug 3, 2023
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 added a commit to platanus/activeadmin_addons that referenced this pull request Aug 3, 2023
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 added a commit to platanus/activeadmin_addons that referenced this pull request Aug 23, 2023
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 added a commit to platanus/activeadmin_addons that referenced this pull request Aug 23, 2023
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
xhero added a commit to rism-digital/muscat that referenced this pull request Jun 17, 2024
naveed-ahmad added a commit to TarteelAI/quranic-universal-library that referenced this pull request Aug 7, 2024
zWOX53b4FRS pushed a commit to slamesbga/signal-wiki that referenced this pull request Mar 12, 2025
quitetarches pushed a commit to sbcandspartan/backpacking that referenced this pull request Mar 26, 2025
tagliala added a commit that referenced this pull request May 1, 2025
This change introduces a custom `active_admin` I18n scope for predicate
translations, allowing ActiveAdmin to override Ransack's defaults while
still falling back to them when necessary.

It addresses discussions about improving localization (#8699) and
resolves potential leftover logic from earlier implementations (#8010)
tagliala added a commit that referenced this pull request May 3, 2025
This change introduces a custom `active_admin` I18n scope for predicate
translations, allowing ActiveAdmin to override Ransack's defaults while
still falling back to them when necessary.

It addresses discussions about improving localization (#8699) and
resolves potential leftover logic from earlier implementations (#8010)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant