Skip to content
This repository was archived by the owner on Sep 16, 2020. It is now read-only.
This repository was archived by the owner on Sep 16, 2020. It is now read-only.

Entity#attributes should only include declared attributes #13

Description

@henrik

Current behaviour:

class MyEntity
  include Minimapper::Entity

  attribute :my_attrib
  attr_accessor :my_accessor
end

e = MyEntity.new(my_attrib: 1, my_accessor: 2)
e.attributes # => { my_attrib: 1, my_accessor: 2 }

Expected behavior:

e = MyEntity.new(my_attrib: 1, my_accessor: 2)
e.attributes # => { my_attrib: 1 }

Since mappers will attempt to persist the attributes, the current behaviour means you can't have "virtual attributes" that don't correspond exactly to a DB column.

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