Skip to content

Commit

Permalink
Fixing errors list
Browse files Browse the repository at this point in the history
  • Loading branch information
dasunpubudumal committed Mar 11, 2024
1 parent cf3d8ae commit 0efecda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/heron/factories/concerns/recipients.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ def check_recipients

next if recipient.valid?

recipient.errors.each { |k, v| errors.add("Recipient at #{coordinate} #{k}", v) }
if recipient.errors.is_a?(ActiveModel::Errors)
recipient.errors.each do |error|
errors.add("Recipient at #{coordinate} #{error.attribute}", error.message)
end
else
recipient.errors.each { |k, v| errors.add("Recipient at #{coordinate} #{k}", v) }
end
end
end

Expand Down

0 comments on commit 0efecda

Please sign in to comment.