github
96 of 103 new or added lines in 20 files covered. (93.2%)
6 existing lines in 2 files now uncovered.2801 of 3069 relevant lines covered (91.27%)
279.03 hits per line
1 |
module Trestle |
7✔ |
2 |
class DebugErrors |
7✔ |
3 |
def initialize(errors) |
7✔ |
4 |
@errors = errors
|
7✔ |
5 |
end
|
|
6 |
|
|
7 |
def any? |
7✔ |
8 |
@errors.any?
|
× |
9 |
end
|
|
10 |
|
|
11 |
def each |
7✔ |
12 |
if defined?(ActiveModel::Error) |
7✔ |
13 |
# Rails 6.1 introduces a unified Error class
|
|
14 |
@errors.each do |error| |
7✔ |
15 |
yield error.attribute, error.message
|
21✔ |
16 |
end
|
|
17 |
else
|
|
UNCOV
18
|
@errors.each do |error, message| |
× |
UNCOV
19
|
yield error, message
|
× |
20 |
end
|
|
21 |
end
|
|
22 |
end
|
|
23 |
end
|
|
24 |
end
|