Skip to content

Can't name has_one associated ':options' #33

@hulloitskai

Description

@hulloitskai

has_one :options doesn't seem to work—however, as a workaround, the following does work:

class MyThingSerializer < Oj::Serializer
  has_one :_options, as: :options, serializer: MyFancyOptionsSerializer do
    my_thing.options
  end
end

Any ideas behind the source of this strange behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions