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

feat: support alias_attribute as valid keys for filter #6956

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brunohkbx
Copy link

Summary

Given a model with an alias_attribute like so:
alias_attribute :title_alias, :title

Then it will be possible to use the alias as a valid filter:
filter :title_alias, as: :select

@javierjulio
Copy link
Member

Does this work with other filter types? What if using a Ransack based filter? This just needs a rebase and push to run CI. Thank you.

Given a model with an alias_attribute like so:
`alias_attribute :title_alias, :title`

Then it will be possible to use the alias as a valid filter:
`filter :title_alias, as: :select`
@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0a1521d) 99.47% compared to head (00e298b) 99.47%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6956   +/-   ##
=======================================
  Coverage   99.47%   99.47%           
=======================================
  Files         308      308           
  Lines       11306    11321   +15     
=======================================
+ Hits        11247    11262   +15     
  Misses         59       59           
Impacted Files Coverage Δ
lib/active_admin/filters/formtastic_addons.rb 96.77% <100.00%> (+0.34%) ⬆️
lib/active_admin/inputs/filters/select_input.rb 100.00% <100.00%> (ø)
spec/unit/filters/filter_form_builder_spec.rb 99.41% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

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 this pull request may close these issues.

None yet

2 participants