Sha256: f403e665b0c4b3978d9626b2be6de145456908ba67400dc0051fd8d457c91371

Contents?: true

Size: 855 Bytes

Versions: 1

Compression:

Stored size: 855 Bytes

Contents

#----------------------------------------------------------------------------
# Set up Mongoid
#----------------------------------------------------------------------------
say "creating 'config/mongoid.yml' Mongoid configuration file..."
run 'rails generate mongoid:config'

say "modifying 'config/application.rb' file for Mongoid..."
append_file 'config/application.rb' do #, :after =>  /\# require \"rails\/test_unit\/railtie\"/ do
<<-RUBY

# If you are deploying to Heroku and MongoHQ,
# you supply connection information here.
require 'uri'
if ENV['MONGOHQ_URL']
  mongo_uri = URI.parse(ENV['MONGOHQ_URL'])
  ENV['MONGOID_HOST'] = mongo_uri.host
  ENV['MONGOID_PORT'] = mongo_uri.port.to_s
  ENV['MONGOID_USERNAME'] = mongo_uri.user
  ENV['MONGOID_PASSWORD'] = mongo_uri.password
  ENV['MONGOID_DATABASE'] = mongo_uri.path.gsub('/', '')
end

RUBY
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
icebreaker-0.2.0 templates/mongoid.rb