8000 Use attribute_types instead of columns_hash to determine type by til · Pull Request #8457 · activeadmin/activeadmin · GitHub
[go: up one dir, main page]

Skip to content

Use attribute_types instead of columns_hash to determine type #8457

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

Conversation

til
Copy link
Contributor
@til til commented Aug 25, 2024

Previously, virtual attributes of type boolean with value nil would not be rendered as status tag. This also improves boolean detection in rare cases when an attribute declaration overrides the type detected in the database.

attribute_types existed already in Rails 6.1, so it should be safe to use.

Copy link
codecov bot commented Aug 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.11%. Comparing base (18e17e4) to head (e3fe8d3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8457   +/-   ##
=======================================
  Coverage   99.11%   99.11%           
=======================================
  Files         141      141           
  Lines        4069     4069           
=======================================
  Hits         4033     4033           
  Misses         36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member
@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

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

Thanks! @tagliala @mgrunberg any concerns with this change? I've used the Attributes API before and makes sense to me. I figured I'd see if either of you know more before merging.

@mgrunberg
Copy link
Contributor

@javierjulio no concerns here, LGTM.

Previously, virtual attributes of type boolean with value `nil` would
not be rendered as status tag. This also improves boolean detection in
rare cases when an `attribute` declaration overrides the type detected
in the database.
@javierjulio javierjulio force-pushed the use-attribute-types-instead-of-columns-hash branch from 4cf9117 to e3fe8d3 Compare August 28, 2024 15:37
@javierjulio javierjulio merged commit 2a1c71b into activeadmin:master Aug 28, 2024
24 checks passed
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.

3 participants
0