Skip to content

Commit

Permalink
Mongo extension to access the db with Mongo.db.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcxplorer committed Mar 3, 2011
1 parent 198933b commit 737a531
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/snowfinch.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
development:
host: "snowfinch.rails.fi:3000"
mailer_sender: "support@snowfinch.net"
mongo_database: "snowfinch"

test:
host: "snowfinch.rails.fi:3000"
mailer_sender: "support@snowfinch.net"
mongo_database: "snowfinch_test"

production:
host: "snowfinch.rails.fi:3000"
mailer_sender: "support@snowfinch.net"
mongo_database: "snowfinch"
10 changes: 10 additions & 0 deletions lib/mongo_ext.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require "mongo"
require "configuration"

module Mongo

def self.db
@db ||= Mongo::Connection.new.db(Snowfinch.configuration["mongo_database"])
end

end

0 comments on commit 737a531

Please sign in to comment.