Skip to content

v3 is breaking existing behavior #342

@kapso

Description

@kapso

We have an attribute params in our serializer, which has started breaking after v3 upgrade.

class NotificationSerializer < BaseSerializer
  attributes :id
  attributes :params # This causes an error in v3
  # attribute :params, &:params # This works in v3
end

Error

/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/alba-3.0.0/lib/alba/resource.rb:268:in `_fetch_attribute_from_resource_first': wrong number of arguments (given 1, expected 0) (ArgumentError)

        __send__(attribute, obj)

I am guessing params is also an internal method, so its not a big deal, but I just wanted to flag it here.

Environment

  • Ruby version: 3.2.2
  • gem 'alba', '3.0.0'
  • gem 'rails', '7.0.8'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions