Created
December 29, 2015 21:58
-
-
Save daneb/160c3d8b9273799ec5ed to your computer and use it in GitHub Desktop.
This file contains hidden or 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/mailer' | |
Dir["#{ __dir__ }/bookmarks/**/*.rb"].each { |file| require_relative file } | |
Lotus::Model.configure do | |
## | |
# Database adapter | |
# | |
# Available options: | |
# | |
# * Memory adapter | |
# adapter type: :memory, uri: 'memory://localhost/hetzner_analytics_development' | |
# | |
# * SQL adapter | |
# adapter type: :sql, uri: 'sqlite://db/hetzner_analytics_development.sqlite3' | |
# adapter type: :sql, uri: 'postgres://localhost/hetzner_analytics_development' | |
# adapter type: :sql, uri: 'mysql://localhost/hetzner_analytics_development' | |
# | |
#adapter type: :sql, uri: ENV['HETZNER_ANALYTICS_DATABASE_URL'] | |
adapter type: :sql, uri: ENV['LEGACY_MYSQL_URL'] | |
## | |
# Migrations | |
# | |
migrations 'db/migrations' | |
schema 'db/schema.sql' | |
## | |
# Database mapping | |
# | |
# Intended for specifying application wide mappings. | |
# | |
# You can specify mapping file to load with: | |
# | |
mapping "#{__dir__}/config/mapping" | |
# | |
# Alternatively, you can use a block syntax like the following: | |
# | |
mapping do | |
# collection :users do | |
# entity User | |
# repository UserRepository | |
# | |
# attribute :id, Integer | |
# attribute :name, String | |
# end | |
end | |
end.load! | |
Lotus::Mailer.configure do | |
root "#{ __dir__ }/bookmarks/mailers" | |
# See http://lotusrb.org/guides/mailers/delivery | |
delivery do | |
development :test | |
test :test | |
# production :stmp, address: ENV['SMTP_PORT'], port: 1025 | |
end | |
end.load! |
collection :bookmarks do
entity BookMark
repository GenieRepository
attribute :id, Integer
attribute :book_mark_entity, Integer
attribute :status, String
end
Try to comment your mapping empty block.
#mapping do
# collection :users do
# entity User
# repository UserRepository
#
# attribute :id, Integer
# attribute :name, String
# end
#end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"mysql2://my_user:my_pass@legacy_mysql_server/bookmarks"