Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lstrzebinczyk committed Aug 22, 2024
1 parent 2da1ea5 commit 961a5ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/granite/action/performing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def perform!(context: nil, **options)
# @return [Object] result of execute_perform! method execution
# @raise [Granite::Action::ValidationError] Action or associated objects are invalid
# @raise [NotImplementedError] execute_perform! method was not defined yet
def try_perform!(context: nil, **options)
def try_perform!(_context: nil, **options)
return unless satisfy_preconditions?

transaction do
validate!(context)
super_run_validations!
perform_action!(**options)
end
end
Expand Down
7 changes: 6 additions & 1 deletion lib/granite/action/preconditions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ def decline_with(*args, **kwargs)
private

def run_preconditions!
@preconditons_run ||= _preconditions.execute!(self)
_preconditions.execute!(self)
errors.empty?
end

def super_run_validations!
_run_validate_callbacks
errors.empty?
end

Expand Down

0 comments on commit 961a5ce

Please sign in to comment.