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

Type casting broken in Rails 7.2.2.1 #47

Open
stevenou opened this issue Dec 23, 2024 · 0 comments
Open

Type casting broken in Rails 7.2.2.1 #47

stevenou opened this issue Dec 23, 2024 · 0 comments

Comments

@stevenou
Copy link

stevenou commented Dec 23, 2024

Tell us about your environment

Ruby Version: 3.3.4

Rails Version: 7.2.2.1

PostgreSQL Version: 14

Store Attribute Version: 2.0.0

What did you do?

  1. Declare the attribute, e.g. store_attribute :settings, :always_on, :boolean
  2. Set a value, e.g. @my_instance.update!(always_on: "1")
  3. Retrieve the value, e.g. @my_instance.always_on

What did you expect to happen?

The retrieved value should be a boolean, e.g. true

What actually happened?

The retrieved value is not correctly cast to the type, e.g. "1"

Note: this worked correctly with Rails 7.2.1.2

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

No branches or pull requests

1 participant