Class: CouchRestRails::Document

Inherits:
CouchRest::ExtendedDocument
  • Object
show all
Includes:
Validatable
Defined in:
lib/couch_rest_rails/document.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) unadorned_database_name



11
12
13
# File 'lib/couch_rest_rails/document.rb', line 11

def self.unadorned_database_name
  database.name.sub(/^#{COUCHDB_CONFIG[:db_prefix]}/, '').sub(/#{COUCHDB_CONFIG[:db_suffix]}$/, '')
end

+ (Object) use_database(db)



6
7
8
9
# File 'lib/couch_rest_rails/document.rb', line 6

def self.use_database(db)
  db = [COUCHDB_CONFIG[:db_prefix], db.to_s, COUCHDB_CONFIG[:db_suffix]].join
  self.database = COUCHDB_SERVER.database(db)
end