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

Entity#attributes should only include declared attributes #13

Open
henrik opened this issue Jul 18, 2013 · 0 comments
Open

Entity#attributes should only include declared attributes #13

henrik opened this issue Jul 18, 2013 · 0 comments

Comments

@henrik
Copy link
Collaborator

henrik commented Jul 18, 2013

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant