Module: CouchPotato
- Defined in:
- lib/couch_potato.rb,
lib/couch_potato/database.rb,
lib/couch_potato/persistence.rb,
lib/couch_potato/view/view_query.rb,
lib/couch_potato/persistence/json.rb,
lib/couch_potato/view/custom_views.rb,
lib/couch_potato/view/raw_view_spec.rb,
lib/couch_potato/view/base_view_spec.rb,
lib/couch_potato/view/model_view_spec.rb,
lib/couch_potato/persistence/callbacks.rb,
lib/couch_potato/view/custom_view_spec.rb,
lib/couch_potato/persistence/properties.rb,
lib/couch_potato/view/properties_view_spec.rb,
lib/couch_potato/persistence/simple_property.rb,
lib/couch_potato/persistence/dirty_attributes.rb,
lib/couch_potato/persistence/magic_timestamps.rb,
lib/couch_potato/persistence/inline_collection.rb,
lib/couch_potato/persistence/belongs_to_property.rb
Defined Under Namespace
Modules: MagicTimestamps, Persistence, View
Classes: Database
Constant Summary
collapse
- Config =
OpenStruct.new
Class Method Summary
collapse
Class Method Details
.couchrest_database ⇒ Object
18
19
20
|
# File 'lib/couch_potato.rb', line 18
def self.couchrest_database
@@__couchrest_database ||= CouchRest.database(full_url_to_database)
end
|
.database ⇒ Object
14
15
16
|
# File 'lib/couch_potato.rb', line 14
def self.database
@@__database ||= Database.new(self.couchrest_database)
end
|
.full_url_to_database ⇒ Object
22
23
24
25
26
27
28
29
|
# File 'lib/couch_potato.rb', line 22
def self.full_url_to_database
database_name = CouchPotato::Config.database_name || raise('No Database configured. Set CouchPotato::Config.database_name')
url = database_name
if url !~ /^http:\/\//
url = "http://localhost:5984/#{database_name}"
end
url
end
|