Skip to content

Commit

Permalink
Reverting rubocop styles to pass the tests initially
Browse files Browse the repository at this point in the history
  • Loading branch information
dasunpubudumal committed Mar 11, 2024
1 parent 6c89632 commit a991ebe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/heron/factories/concerns/eventful.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ def add_all_errors_from_events(events)
end

def add_all_errors_from_event(event)
event.errors.each { |key, value| errors.add(key, value) }
if event.errors.is_a?(ActiveModel::Errors)
event.errors.each do |error|
errors.add(error.attribute, error.message)
end
else
event.errors.each { |key, value| errors.add(key, value) }
end
end

def rollback_for_events(events)
Expand Down

0 comments on commit a991ebe

Please sign in to comment.