Merge commit 'mattetti/master'
This commit is contained in:
commit
1e44302d1a
25 changed files with 695 additions and 135 deletions
|
@ -13,10 +13,11 @@ module CouchRest
|
|||
include CouchRest::Mixins::DesignDoc
|
||||
include CouchRest::Mixins::ExtendedAttachments
|
||||
include CouchRest::Mixins::ClassProxy
|
||||
include CouchRest::Mixins::Collection
|
||||
|
||||
def self.subclasses
|
||||
@subclasses ||= []
|
||||
end
|
||||
def self.subclasses
|
||||
@subclasses ||= []
|
||||
end
|
||||
|
||||
def self.inherited(subklass)
|
||||
subklass.send(:include, CouchRest::Mixins::Properties)
|
||||
|
@ -51,6 +52,26 @@ module CouchRest
|
|||
end
|
||||
end
|
||||
|
||||
# Defines an instance and save it directly to the database
|
||||
#
|
||||
# ==== Returns
|
||||
# returns the reloaded document
|
||||
def self.create(options)
|
||||
instance = new(options)
|
||||
instance.create
|
||||
instance
|
||||
end
|
||||
|
||||
# Defines an instance and save it directly to the database
|
||||
#
|
||||
# ==== Returns
|
||||
# returns the reloaded document or raises an exception
|
||||
def self.create!(options)
|
||||
instance = new(options)
|
||||
instance.create!
|
||||
instance
|
||||
end
|
||||
|
||||
# Automatically set <tt>updated_at</tt> and <tt>created_at</tt> fields
|
||||
# on the document whenever saving occurs. CouchRest uses a pretty
|
||||
# decent time format by default. See Time#to_json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue