norman / ambry

Ambry is a database and ORM replacement for (mostly) static models and small datasets. It provides ActiveModel compatibility, and flexible searching and storage.
http://rubydoc.info/github/norman/ambry/master/frames
MIT License
57 stars 3 forks source link

Mapper should pass key when initializing models #5

Closed esad closed 13 years ago

esad commented 13 years ago

Currently, if we have the following model

class Person
  extend Ambry::Model
  field :email, :name
end

when initialized with following yaml data

foo@bar.com:
  name: Foo

the "email" field won't be set, but is needed to be explicitly present:

foo@bar.com:
  name: Foo
  email: foo@bar.com
norman commented 13 years ago

Yeah, makes sense. Having to specify the key twice is definitely annoying and unnecessary.

norman commented 13 years ago

Pulled.