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 aa2ee87 commit 2f8dff9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/granite/action/performing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def try_perform!(context: nil, **options)
return unless satisfy_preconditions?

transaction do
super_run_validations!(context) || raise_validation_error
# super_run_validations!(context) || raise_validation_error
validate!(context)
perform_action!(**options)
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/granite/action/preconditions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def add_precondition(klass, *args, &block)

def initialize(*)
@failed_preconditions = []
@preconditions_run = nil
super
end

Expand All @@ -106,7 +107,7 @@ def decline_with(*args, **kwargs)
private

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

Expand Down

0 comments on commit 2f8dff9

Please sign in to comment.