Class: Fasta::Server::Actions::Patch

Inherits:
Core::Write show all
Defined in:
lib/fasta/server/actions/patch.rb

Direct Known Subclasses

Model::Patch

Constant Summary

Constants inherited from Core::Responder

Core::Responder::DB

Instance Attribute Summary

Attributes inherited from Core::Responder

#headers, #params, #request

Instance Method Summary collapse

Methods inherited from Core::Write

#call

Methods inherited from Core::Responder

#body, call, #call, #db_table, #db_table_name, #initialize, #response_code, #to_rack_array, validate_fields

Constructor Details

This class inherits a constructor from Fasta::Server::Core::Responder

Instance Method Details

#default_response_codeObject



7
8
9
# File 'lib/fasta/server/actions/patch.rb', line 7

def default_response_code
  200
end

#successObject



11
12
13
14
# File 'lib/fasta/server/actions/patch.rb', line 11

def success
  db_table.where(id: params[:id]).update(params.merge(default_updated_at))
  db_table.first(id: params[:id])
end