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

v3 has breaking change (parameters defaults to nil) #386

Closed
2called-chaos opened this issue Feb 2, 2024 · 2 comments
Closed

v3 has breaking change (parameters defaults to nil) #386

2called-chaos opened this issue Feb 2, 2024 · 2 comments
Assignees
Labels

Comments

@2called-chaos
Copy link

We upgraded from 2.0.2 to 3.0 and noticed a breaking change, that is parameters defaults to nil now. Can we revert this behavior or was this done for a reason?

Using public_activity 2.0.2
irb(main):001> PublicActivity::Activity.new.parameters
=> {}

Using public_activity 3.0.0 (was 2.0.2)
irb(main):001> PublicActivity::Activity.new.parameters
=> nil

@2called-chaos 2called-chaos changed the title v3 has breaking change v3 has breaking change (parameters defaults to nil) Feb 2, 2024
@2called-chaos
Copy link
Author

On further investigation this change stems from 1575d8c and the fact that Rails - when using serialize :col, Hash - used to check for the second argument to

  • be literal ::JSON (and then use a Rails wrapper)
  • respond to both load and dump (which Hash does not)
  • fallback to use Coders::YAMLColumn (instead of just YAML)

The YAMLColumn coder guards against nil values with return object_class.new if object_class != Object && yaml.nil? (recently this has moved to Coders::ColumnSerializer in Rails)

@ur5us
Copy link
Collaborator

ur5us commented Feb 8, 2024

@2called-chaos I’ll release a patch release in a few days to address this issue.

@ur5us ur5us self-assigned this Feb 8, 2024
@ur5us ur5us added the bug label Feb 8, 2024
@ur5us ur5us closed this as completed in 2e43ea4 Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants