Skip to content

Commit

Permalink
Attempt to fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Saverio Trioni authored Sep 20, 2021
1 parent 6f90086 commit 6e7d044
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/granite/action/preconditions/embedded_precondition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ def decline_action(context, action)
end

def merge_errors(target, source)
if source.respond_to?(:where)
# ActiveModel::Errors from version 6.1
source.where(:base).each { |error| target.import(error) }
else
# ActiveModel::Errors until version 6.0
source[:base].each { |error| target.add(:base, error) }
end
source.respond_to?(:where) ? source.where(:base).each { |error| target.import(error) } : source[:base].each { |error| target.add(:base, error) }
end
end
end
Expand Down

0 comments on commit 6e7d044

Please sign in to comment.