All Versions
47
Latest Version
Avg Release Cycle
65 days
Latest Release
-
Changelog History
Page 3
Changelog History
Page 3
-
v2.0.0 Changes
All old semantics will be available via trailblazer-compat.
- ✂ Removed
Operation::run
as it was a bad decision. Raising an exception on invalid is a very test-specific scenario and shouldn't have been handled in the core doce. - ✂ Removed
Operation::present
, since you can simply callOperation::new
(without builders) orOperation::build_operation
(with builders). - ✂ Removed
Operation::valid?
. This is in the result object viaresult.success?
. - ✂ Removed
Operation#errors
. This is in the result object viaresult[:errors]
if the operation was invalid. Removed the private option
:raise_on_invalid
. UseContract::Raise
instead, if you need it in tests.✂ Removed
Operation::contract
(without args). Please useOperation::["contract.default.class"]
.✂ Removed
Operation::callbacks
(without args). Please useOperation::["callback.<name>.class"]
.✂ Removed
Operation::contract_class
. Please useOperation::["contract.default.class"]
.✂ Removed
Operation::contract_class=
. Please useOperation::["contract.default.class"]=
. Doesn't inherit.
Model
- The
model
method doesn't exist anymore, useself["model"]
or write your own. :find_by
diverts to left track.:create
is:new
now.
🏗 Builder
- 🏗 It's
include Builder
now, notextend Builder
. - 🏗
builds
now receives one options hash.
Policy
- 👻 No exception anymore, but
Operation#["policy.result"]
. - Access the current user via
self["current_user"]
now. - 💅
Policy
isPolicy::Pundit
now asPolicy
is Trailblazer's (upcoming) authorization style.
Representer
- ✂ Removed
Operation::representer_class
. Please useOperation::["representer.class"]
. - ✂ Removed
Operation::representer_class=
. Please useOperation::["representer.class"]=
. - 📜 You can now have any number of named representers:
Operation.representer :parser, ParsingRepresenter
. - Automatic infering of the representer from a
contract
is not so automatic anymore. This feature was barely used and is now available viainclude Representer::InferFromContract
. - 👍 Reform 2.0 is not supported in
Representer
anymore, meaning you can't automatically infer representers from 2.0 contracts. Reform 2.0 works with all remaining components. - ✂ Removed
Operation::contract_class
. Please useOperation::["contract.default.class"]
. - ✂ Removed
Operation::contract_class=
. Please useOperation::["contract.default.class"]=
. Doesn't inherit.
Callback
- ✂ Removed
Operation::Dispatch
, it's calledOperation::Callback
.
Collection
- ✂ Removed
Operation::Collection
. Please useOperation::present
.
Controller
- ✂ Removed
Controller
, this is now in trailblazer-rails.
Contract
- 0️⃣ You can't call
Create.().contract
anymore. The contract instance(s) are available through theResult
object via["contract.default"]
. - ✂ Removed the deprecation for
validate
, signature is(params[, model, options, contract_class])
. - ✂ Removed the deprecation for
contract
, signature is([model, options, contract_class])
.
- ✂ Removed
-
v2.0.0.rc2 Changes
- It's now Contract::Persist( name: "params" ) instead of ( name: "contract.params" ).
-
v2.0.0.rc1 Changes
- 🚚
consider
got removed sincestep
now evaluates the step's result and deviates (or not).
- 🚚
-
v2.0.0.beta3 Changes
- 🆕 New, very slick keyword arguments for steps.
-
v2.0.0.beta2 Changes
- ✂ Removed
Operation::Controller
. - 📇 Renamed
Persist
toContract::Persist
. - Simplify inheritance by introducing
Operation::override
. Contract
paths are now consistent.
- ✂ Removed
-
v2.0.0.beta1 Changes
- Still undefined
self.~
.
- Still undefined
-
v1.1.2 Changes
- Stricter
uber
dependency.
- Stricter
-
v1.1.1 Changes
- 📇 Rename
Operation::Representer::ClassMethods
toOperation::Representer::DSL
and allow to useDSL
andRendering
withoutDeserialization
so you can use two different representers. Policy::Guard::policy
now also accepts aCallable
object.- ➕ Add
Operation#model=
.
- 📇 Rename
-
v1.1.0 Changes
- 0️⃣
Representer#represented
defaults tomodel
now, not tocontract
anymore. - The only way to let Trailblazer pass a document to the operation is via
is_document: true
. There is no guessing anymore based on whether or notRepresenter
is mixed into the operation or not. - ➕ Add
Operation#params!
that works exactly like#model!
: return another params hash here if you want to change theparams
structure while avoiding modifying the original one. - ➕ Add
Controller#params!
that works exactly likeOperation#params!
and allows returning an arbitrary params object in the controller. Thanks to @davidpelaez for inspiration. - 🗄 Deprecate
Dispatch
in favor ofCallback
. In operations, please includeOperation::Callback
. Also, introducedOperation#callback!
which aliases to#dispatch!
. Goal is having to think less, and now all naming is in line.
🛠 Fixes
Representer#to_json
now allows passing options.- 🛠 The
:params
key never got propagated toprepopulate!
when usingController#form
. This is now fixed.
- 0️⃣
-
v1.0.4 Changes
- 🛠 Fix
Controller#run
, which now returns the operation instance instead of theElse
object.
- 🛠 Fix