Skip to content

Instantly share code, notes, and snippets.

@daneb
Created December 29, 2015 21:58
Show Gist options
  • Save daneb/160c3d8b9273799ec5ed to your computer and use it in GitHub Desktop.
Save daneb/160c3d8b9273799ec5ed to your computer and use it in GitHub Desktop.
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!
@trantuanckc
Copy link

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