Skip to content

Undefined method `map' #456

@mdi

Description

@mdi

Using v 127413f. I think this issue is maybe related to #414, or the changes that came from it.

If I enable embed_in_root, I get an error similar to this:

undefined method `map' for #<Venue:0x007ffecb5718a0>

It seems it may be coming from this line.

Initializer:

ActiveModel::Serializer.setup do |config|
  config.embed = :ids
  config.embed_in_root = true
end

EventSerializer:

class EventSerializer < ActiveModel::Serializer
  has_one :venue, embed_key: :slug
  has_many :acts, embed_key: :slug
end

VenueSerializer:

class VenueSerializer < ActiveModel::Serializer
  has_many :events, embed_key: :slug
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions