- Undeprecate the
Granite::Action#perform
method.
- Stopped preconditions from being executed twice on
#try_perform!
- Deprecate
Granite::Action#perform
in favor of usingGranite::Action#try_perform!
, as these 2 methods are basically identical. It will be removed in next major version. (#117)
- Fix in_transaction collisions with other gems (#112)
- Support for ruby 3.2 by @konalegi in #100
- Refine main page of the Granite docs by @jarosluv in #101
- Refine documentation. Part 2 by @jarosluv in #103
- Support for Rails 7.1 by @ojab and @dependabot in #107
- [BREAKING] Drop support for Rails < 6.0 by @ojab and @dependabot in #107
- Add
after_initialize
callback. - Fix
after_commit
being called even ifperform
fails (because of failing preconditions/validations). - Extract
Granite::Util
togranite-form
. It's now calledGranite::Form::Util
. - [BREAKING] Change granite projector specs to use controller specs instead of request specs:
- This means that you'll have to replace
get projector.action_path
withget :action
. - As a temporary measure you should be able to
include RSpec::Rails::RequestExampleGroup
in your describe block to use request specs temporarily. This is not guaranteed to not break in the future.
- This means that you'll have to replace
- Remove
BA
prefix in granite action generator - Remove automatic synchronization from
embeds_many
/embeds_one
associated objects (action.association
) to their appropriate virtual attribute (action.attributes('association')
) - Update minimum granite-form version to 0.3.0
- [BREAKING] Change form builder from ActiveData to Granite::Form. This means Granite no longer depends on ActiveData, Granite::Form currently is a direct replacement for ActiveData that uses same syntax.
- Add support for detecting types of aliased attributes when using
represents
- Fix error existence check on
Granite::Action#merge_errors
in Rails 6.1 - Add
Granite::Action.subject?
helper method - Fix ActiveRecord::Enum handling with represents
- Introduce the ruby2_keywords (https://github.com/ruby/ruby2_keywords) gem in order to provide compatibility with Ruby 3 for some internal methods
- Introduce instrumentation and RSpec matcher to check if action was performed: https://toptal.github.io/granite/testing/#testing-composition
- Introduce
Action.with
as a more powerful replacement forAction.as
, that allows passing more than just performer: https://toptal.github.io/granite/#context-performer
- Fix Ruby 3 Warnings
- Improve how projector specs initialize controller to be more rails like and fix several issues.
- [BREAKING] As a result abstract actions/projectors will have to be initialized using
prepend_before
in projector specs.
- [BREAKING] As a result abstract actions/projectors will have to be initialized using
- Fix parameterized precondition error messages not working in Ruby 3.
- Support for Rails 6.1 (via https://github.com/toptal/active_data fork)
- Support for Rails 7.0
- Fix
represents
withdefault: false
not seeing any changes in model
- Make
assign_data
protected so that it can be called from other actions.
- [BREAKING] Implemented
assign_data
, which replacesbefore_validation
as a way to set data for models before validations. - Converted
represents
to useassign_data
- Fix dispatcher not working correctly with blank routes (e.g.
post :perform, as: ''
)
- Fix Ruby 2.7 and 3.0 compatibility issues
- Simplify translations code when expanding relative keys (
.key
) - Fix one Ruby 3 incompatibility
- Extract
Granite::Util
which allows evaluating conditions
- fix
represents
to skip not defined attributes on the reference
- fix gemspec to include
config
directory - update readme
- add rubocop config that can be included in projects using Granite
- fix documentation
- add Rails 6 support
- fix path helper to work with string arguments
- move
apply_association_changes!
to perform block
satisfy_preconditions
matcher supports composable matchers.
satisfy_preconditions
matcher supports regular expressions
- remove callback loop triggered by executing action in
after_commit
of another action
-
nested executions of actions creates a proper nested transactions using
ActiveRecord::Base.transaction(requires_new: true)
. See how it works at Nested Transaction section -
don't silence
Granite::Action::Rollback
error when there is noActiveRecord
- introduced
after_commit
callback for actions
-
represents
attribute with a default value updates corresponding model's attribute even when action's attribute was not changed -
represented value of model goes through defaultize and typecaster
represents
supportsallow_nil
option
In the beginning was the Word, and the Word was Granite