Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Re-add couch model

  • Loading branch information...
commit 4c6e10d6c800451fe2f3589d5be251946c39cdbb 1 parent b19bd8a
Phil McClure overture8 authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 app/models/couch.rb
20 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
Please sign in to comment.
Something went wrong with that request. Please try again.