Sha256: 650adc108306cc935933caf001fbafa57659e5b61ed45c01e899c8bd9f5f5835

Contents?: true

Size: 603 Bytes

Versions: 15

Compression:

Stored size: 603 Bytes

Contents

class <%= @name.camelcase %>::Application
  <%- unless @no_database -%>
  default_dbconfig_file = File.expand_path('../../../config/database.yml', __FILE__)
  <%- if @database != 'mongo' || @database != 'mongodb' -%>

  # ActiveRecord connection
  require 'active_record'
  if File.exist? default_dbconfig_file
    ActiveRecord::Base.configurations = YAML::load(open(default_dbconfig_file))
  else
    raise Errno::ENOENT
  end
  ActiveRecord::Base.establish_connection environment
  <% else -%>
  # MongoID connections
  Mongoid.load!(default_dbconfig_file, environment)
  <% end -%>
  <% end -%>

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
aetherg-0.5.1 lib/templates/config/initializers/connection.rb
aetherg-0.5.0 lib/templates/config/initializers/connection.rb
aetherg-0.5.0.beta3 lib/templates/config/initializers/connection.rb
aetherg-0.5.0.beta2 lib/templates/config/initializers/connection.rb
aetherg-0.5.0.beta lib/templates/config/initializers/connection.rb
aetherg-0.3.4 lib/templates/config/initializers/connection.rb
aetherg-0.3.3 lib/templates/config/initializers/connection.rb
aetherg-0.3.2 lib/templates/config/initializers/connection.rb
aetherg-0.3.1 lib/templates/config/initializers/connection.rb
aetherg-0.2.7 lib/templates/config/initializers/connection.rb
aetherg-0.2.5 lib/templates/config/initializers/connection.rb
aetherg-0.2.2 lib/templates/config/initializers/connection.rb
aetherg-0.2.1 lib/templates/config/initializers/connection.rb
aetherg-0.2.0 lib/templates/config/initializers/connection.rb
aetherg-0.1.8 lib/templates/config/initializers/connection.rb