All Versions
47
Latest Version
Avg Release Cycle
65 days
Latest Release
-
Changelog History
Page 4
Changelog History
Page 4
-
v1.0.3 Changes
- โ Remove unprofessional
puts
, @smathy.
- โ Remove unprofessional
-
v1.0.2 Changes
- Treat all requests as
params
requests unless the operation has a representer mixed in. If you don't want that, you can override usingis_document: false
. This appears to be the smoothest solution for all. - In
Controller#form
, the options argument is now passed intoform.prepopulate!(options)
. This allows to use arbitrary options and theoptions[:params]
for prepopulation.
- Treat all requests as
-
v1.0.1 Changes
- Treat
:js
requests as non-document, too. Controller#form
now returns the form object and not the operation.- In
Controller
,#form
,#present
,#run
and#respond
now all have the same API:run(constant, options)
. If you want to pass a custom params hash, userun Comment::Create, params: {..}
.
- Treat
-
v1.0.0 Changes
- ๐
All Rails-relevant files are now in the
trailblazer-rails
gem. You have to include it should you be in a Rails environment. - ๐
Operation[{..}]
is deprecated in favor ofOperation.({..})
. Operation::CRUD
is nowOperation::Model
.Controller#form
now invokes#prepopulate!
before rendering the view.Controller#present
does not instantiate and assign@form
anymore.- The internal
Operation
API has changed from#initialize()
and#run(params)
to#initialize(params)
and#run
.
- ๐
All Rails-relevant files are now in the
-
v0.3.4 Changes
- โ Added
Operation::Policy
. - โ Added
Operation::Resolver
.
- โ Added
-
v0.3.3 Changes
- Add
Operation::reject
which will run the block when invalid. - ๐
In the railtie, require
trailblazer/autoloading
as I am assuming Rails users want maximum comfort.
- Add
-
v0.3.2 Changes
- Allow to use
#contract
before#validate
. The contract will be instantiated once per#run
using#contract
and then memoized. This allows to add/modify the contract before you validate it using#validate
. - New signature for
Operation#contract_for(model, contract_class)
. It used to be contract, then model.
- Allow to use
-
v0.3.1 Changes
- Autoload
Dispatch
.
- Autoload
-
v0.3.0 Changes
๐ Changes
- In Railtie, use
ActionDispatch::Reloader.to_prepare
for autoloading, nothing else. This should fix spring reloading. - ๐ Allow
Op#validate(params, model, Contract)
with CRUD. - ๐ Allows prefixed table names, e.g.
admin.users
inController
. The instance variables will be@user
. Thanks to @fernandes and especially @HuckyDucky. - โ Added
Operation::Collection
which will allow additional behavior like pagination and scoping. Thanks to @fernandes for his work on this. - โ Added
Operation::collection
to runsetup!
without instantiating a contract. This is called in the newController#collection
method. - โ Added
Operation#model
as this is a fundamental concept now. - ๐ Improved the undocumented
Representer
module which allows inferring representers from contract, using them to deserialize documents for the form, and rendering documents. - ๐ Changed
Operation::Dispatch
which now provides imperative callbacks.
API change
- The return value of #process is no longer returned from ::run and ::call. They always return the operation instance.
The return value of #validate is
true
orfalse
. This allows a more intuitive operation body.def process(params) if validate(params) .. do valid else .. handle invalid end end
- ๐ท
Worker
only works with Reform >= 2.0.0.
- In Railtie, use
-
v0.2.3