Closed mguentner closed 6 years ago
@mguentner just realised that the contract_documents table is just straightforward joiner table for http://guides.rubyonrails.org/association_basics.html#the-has-and-belongs-to-many-association. example: https://github.com/buzzn/core/blob/master/app/models/person.rb#L13
i.e. we do not need the model ContractDocument AR record is just doing the whole magic right. also the table does not need a primary_key: see https://github.com/buzzn/core/blob/master/db/migrate/012_create_persons_roles.rb
FYI: I will delete lib/tasks/zip2price.rake as it fails some rake tasks and is not needed anymore
and a few other cleanups like remove this resource.destroy
and the unused PersonRole model
@mguentner oh I messed up your branch - sorry. please remove the last commit of mine again when you rebase the branch.
merged manually - closing
~adds /localpools/{}/contracts/{}/document~
~what it does~
~Each instance of a model represents a (mostly) mutable object in our database. The
document
verb and endpoint can be used to create a snapshot of it. Our current way of doing this, is creating a.pdf
, for a contract that would be something printable and sign-able.~adds /localpools/{}/contracts/{}/documents/generate
what it does
Each instance of a model represents a (mostly) mutable object in our database. The
document
verb and a matching endpoint can be used to create a snapshot of it. Our current way of doing this, is creating a.pdf
, for a contract that would be something printable and sign-able.adds /localpools/{}/contracts/{}/documents
what is does
POST
: adds a file to the contract, e.g. pdf)GET
: lists all documentsadds /localpools/{}/contracts/{}/documents/{}
what is does
GET
: gets the metadata of that fileDELETE
: deletes the file from the contractadds /localpools/{}/contracts/{}/documents/{}/fetch
what is does
GET
: serves the actual file