Trailblazer v0.3.0 Release Notes
-
๐ 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