Skip to content

Commit

Permalink
Added instance accessor for CouchRest database connection object
Browse files Browse the repository at this point in the history
  • Loading branch information
topfunky committed Sep 14, 2008
1 parent 435f723 commit 596701c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/basic_model.rb
Expand Up @@ -51,6 +51,10 @@ def self.db(database_name)
database
end

def db
self.class.db(@database_name)
end

def initialize(database_name, attributes={})
@database_name = database_name
@attributes = default_attributes.merge(attributes)
Expand Down

0 comments on commit 596701c

Please sign in to comment.