trailblazer / trailblazer.github.io

The TRAILBLAZER.TO website. Please PR against the f6 branch. 💋
http://trailblazer.to
23 stars 55 forks source link

Specify what params to pass #71

Closed ramontayag closed 7 years ago

ramontayag commented 7 years ago

The first argument in an operation expects the params of the model

apotonick commented 7 years ago

Hm, that's not correct as it will break in Update operations. You should always pass the entire params hash into the op and let the op extract what it needs.

ramontayag commented 7 years ago

Oh interesting. This is what I had to do to get it to work. My contract kept saying everything was blank.

apotonick commented 7 years ago

You need this: http://trb.to/gems/operation/2.0/contract.html#extracting-params

ramontayag commented 7 years ago

Ah yes thank you