-
-
Notifications
You must be signed in to change notification settings - Fork 541
/
app_name.rb.tt
37 lines (35 loc) · 1.06 KB
/
app_name.rb.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'lotus/model'
Dir["#{ __dir__ }/<%= config[:app_name] %>/**/*.rb"].each { |file| require_relative file }
Lotus::Model.configure do
# Database adapter
#
# Available options:
#
# * Memory adapter
# adapter type: :memory, uri: 'memory://localhost/<%= config[:app_name] %>_development'
#
# * SQL adapter
# adapter type: :sql, uri: 'sqlite://db/<%= config[:app_name] %>_development.db'
# adapter type: :sql, uri: 'postgres://localhost/<%= config[:app_name] %>_development'
# adapter type: :sql, uri: 'mysql://localhost/<%= config[:app_name] %>_development'
#
adapter type: :file_system, uri: ENV['<%= config[:app_name].to_env_s %>_DATABASE_URL']
##
# Database mapping
#
# 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!