Class: ROM::CouchDB::Commands::Update

Inherits:
ROM::Commands::Update
  • Object
show all
Defined in:
lib/rom/couchdb/commands.rb

Overview

CouchDB update command

Instance Method Summary collapse

Instance Method Details

#collectionObject


21
22
23
# File 'lib/rom/couchdb/commands.rb', line 21

def collection
  relation.dataset
end

#execute(object) ⇒ Object


25
26
27
28
29
# File 'lib/rom/couchdb/commands.rb', line 25

def execute(object)
  document = object.dup
  collection << document
  [document]
end