Skip to content

Commit

Permalink
refactor DB constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
benatkin committed Jun 27, 2011
1 parent a81bb7b commit e5e6fe2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/models/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
module Hurl
class DB
def self.couch
return @couch if @couch
couch_url = ENV['COUCH_URL'] if !!ENV['COUCH_URL']
couch_url = ENV['CLOUDANT_URL'] if !!ENV['CLOUDANT_URL']
if couch_url
@couch = CouchRest.database(couch_url)
end
@couch_url ||= ENV['COUCH_URL'] || ENV['CLOUDANT_URL']
@couch ||= CouchRest.database(@couch_url) if @couch_url
end

def self.find(scope, id)
Expand Down

0 comments on commit e5e6fe2

Please sign in to comment.