Sha256: 770a61cd3cee5ad7cc4399d811bae862593e4d6fe1cd6b63a87eb82625e42e61

Contents?: true

Size: 1.52 KB

Versions: 1

Compression:

Stored size: 1.52 KB

Contents

require 'hanami/model'
require 'hanami/mailer'
Dir["#{ __dir__ }/<%= config[:project_name] %>/**/*.rb"].each { |file| require_relative file }

Hanami::Model.configure do
  ##
  # Database adapter
  #
  # Available options:
  #
  #  * File System adapter
  #    adapter type: :file_system, uri: 'file:///db/bookshelf_development'
  #
  #  * Memory adapter
  #    adapter type: :memory, uri: 'memory://localhost/<%= config[:project_name] %>_development'
  #
  #  * SQL adapter
  #    adapter type: :sql, uri: 'sqlite://db/<%= config[:project_name] %>_development.sqlite3'
  #    adapter type: :sql, uri: 'postgres://localhost/<%= config[:project_name] %>_development'
  #    adapter type: :sql, uri: 'mysql://localhost/<%= config[:project_name] %>_development'
  #
  adapter type: :<%= config[:database_config][:type] %>, uri: ENV['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.
  #
  mapping do
    # collection :users do
    #   entity     User
    #   repository UserRepository
    #
    #   attribute :id,   Integer
    #   attribute :name, String
    # end
  end
end.load!

Hanami::Mailer.configure do
  root "#{ __dir__ }/<%= config[:project_name] %>/mailers"

  # See http://hanamirb.org/guides/mailers/delivery
  delivery do
    development :test
    test        :test
    # production :smtp, address: ENV['SMTP_PORT'], port: 1025
  end
end.load!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hanami-0.8.0 lib/hanami/generators/application/container/lib/project.rb.tt