Created
December 12, 2014 20:15
-
-
Save ryanbrunner/22b14a368f047248b90a to your computer and use it in GitHub Desktop.
Lotus Model problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'lotus-model' | |
require 'lotus/model/adapters/memory_adapter' | |
module Admin | |
module Models | |
class Feature | |
include Lotus::Entity | |
self.attributes = :name | |
end | |
class FeatureRepository | |
include Lotus::Repository | |
end | |
end | |
end | |
mapping = Lotus::Model::Mapper.new do | |
collection :features do | |
entity Admin::Models::Feature | |
attribute :id, Integer | |
attribute :name, String | |
end | |
end | |
Admin::Models::FeatureRepository.adapter = Lotus::Model::Adapters::MemoryAdapter.new(mapping) | |
Admin::Models::FeatureRepository.all # <= Lotus::Model::Mapping::UnmappedCollectionError: Cannot find collection: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment