Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't read config/mongo.yml, but expect MONGO_URL and/or friends to b…

…e present.
  • Loading branch information...
commit 79acfc625e5e64bb09964a8d3231a1f91cf42e0b 1 parent 7df4703
@hmans authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/schnitzelpress.rb
View
7 lib/schnitzelpress.rb
@@ -43,7 +43,12 @@ def mongo_uri=(uri)
end
def init!
- Mongoid.load!("./config/mongo.yml")
+ # Mongoid.load!("./config/mongo.yml")
+ if mongo_uri = ENV['MONGOLAB_URI'] || ENV['MONGOHQ_URL'] || ENV['MONGO_URL']
+ self.mongo_uri = mongo_uri
+ else
+ raise "Please set MONGO_URL, MONGOHQ_URL or MONGOLAB_URI to your MongoDB connection string."
+ end
Schnitzelpress::Post.create_indexes
end
Please sign in to comment.
Something went wrong with that request. Please try again.