Sha256: a3d70a8dce341ccb5fbec12cd82411a1409e80d1cae8580650694636c6dafa21

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

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.sqlite3'
  #    adapter type: :sql, uri: 'postgres://localhost/<%= config[:app_name] %>_development'
  #    adapter type: :sql, uri: 'mysql://localhost/<%= config[:app_name] %>_development'
  #
  adapter type: :<%= config[:database_config][:type] %>, uri: ENV['<%= config[:app_name].to_env_s %>_DATABASE_URL']

  <%- if config[:database_config][:type] == :sql -%>
  ##
  # Migrations
  #
  migrations 'db/migrations'
  schema     'db/schema.sql'

  <%- end -%>
  ##
  # 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!

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lotusrb-0.4.1 lib/lotus/generators/application/container/lib/app_name.rb.tt
lotusrb-0.4.0 lib/lotus/generators/application/container/lib/app_name.rb.tt