Skip to content

Instantly share code, notes, and snippets.

@ryanbrunner
Created December 12, 2014 20:15
Show Gist options
  • Save ryanbrunner/22b14a368f047248b90a to your computer and use it in GitHub Desktop.
Save ryanbrunner/22b14a368f047248b90a to your computer and use it in GitHub Desktop.
Lotus Model problem
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