Open mcamou opened 10 years ago
This would be useful for non-state attributes (mainly configs). Usage example:
module AppConfig
extend EmbeddableValue
attribute :name, String
#...
end
end
class Foo < BaseEntity
include AppConfig
attribute :my_foo, String
attribute : my_bar, String
#...
end
#...
Dilithium::PersistenceService.configure do |service|
service.entity_mappers(
:default => :'EntityMapper::Sequel',
:AppConfig => :'EntityMapper::Sequel::Json'
)
end
This is just pseudo-code. Should AppConfig
be a reference? a child? Is class/module level enough? Maybe at attr level?
The currently-implemented Mapper uses Sequel to persist to relational databases. Implement a Mapper that can persist to JSON stores (i.e., MongoDB, PostgreSQL JSON datatype)