You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/active_record_doctor/detectors/missing_presence_validation.rb
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,14 @@ class MissingPresenceValidation < Base # :nodoc:
21
21
22
22
private
23
23
24
-
defmessage(type:,column_or_association:,model:)
24
+
defmessage(type:,column:,reflection:,model:)
25
25
casetype
26
26
when:missing_validator
27
-
"add a `presence` validator to #{model}.#{column_or_association} - it's NOT NULL but lacks a validator"
27
+
"add a `presence` validator to #{model}.#{column} - it's NOT NULL but lacks a validator"
28
28
when:optional_association
29
-
"add `optional: false` to #{model}.#{column_or_association} - the foreign key #{column_or_association}_id is NOT NULL"# rubocop:disable Layout/LineLength
29
+
"add `optional: false` to #{model}.#{reflection.name} - the foreign key #{reflection.foreign_key} is NOT NULL"
30
30
when:optional_polymorphic_association
31
-
"add `optional: false` to #{model}.#{column_or_association} - the foreign key #{column_or_association}_id or type #{column_or_association}_type are NOT NULL"# rubocop:disable Layout/LineLength
31
+
"add `optional: false` to #{model}.#{reflection.name} - the foreign key #{reflection.foreign_key} or type #{reflection.foreign_type} are NOT NULL"# rubocop:disable Layout/LineLength
32
32
end
33
33
end
34
34
@@ -125,7 +125,7 @@ def detect
125
125
126
126
# ... report an error about an incorrectly configured polymorphic
0 commit comments