Permalink
Browse files

Re-add couch model

  • Loading branch information...
1 parent b19bd8a commit 4c6e10d6c800451fe2f3589d5be251946c39cdbb @overture8 overture8 committed Sep 22, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 app/models/couch.rb
View
@@ -0,0 +1,20 @@
+module Couch
+
+ class << self
+
+ def domain
+ return "http://#{ENV['COUCHBASE_DOMAIN']}" if ENV['COUCHBASE_DOMAIN']
+ case Rails.env.to_s
+ when "production" then "http://localhost"
+ when "test" then "http://localhost"
+ when "development" then "http://localhost"
+ end
+ end
+
+ def client
+ @client ||= Couchbase.new "#{domain}:8091/pools/default"
+ end
+
+ end
+
+end

0 comments on commit 4c6e10d

Please sign in to comment.