Class: Idxfence::Finding
- Inherits:
-
Struct
- Object
- Struct
- Idxfence::Finding
- Defined in:
- lib/idxfence/finding.rb
Overview
A single ActiveRecord uniqueness: true validation (application-layer
only) with no matching database-level unique index to back it up --
meaning two concurrent requests can both pass the validation's
SELECT ... WHERE check before either one's INSERT commits, landing
a genuine duplicate row despite the validation "working." See
DETAILS.md for the exact race and why only a DB-level unique index
closes it.
code: "IX001" every finding uses this single code (one rule: an AR
uniqueness validation with no matching DB unique index)
model: the model class name, e.g. "User"
table: the resolved table name the validation's column(s) were
checked against, e.g. "users"
column: the column the validation checks, e.g. "email"
scope: Arrayvalidates/validates_uniqueness_of call
message: a human-readable description
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#column ⇒ Object
Returns the value of attribute column.
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
-
#message ⇒ Object
Returns the value of attribute message.
-
#model ⇒ Object
Returns the value of attribute model.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
21 22 23 |
# File 'lib/idxfence/finding.rb', line 21 def code @code end |
#column ⇒ Object
Returns the value of attribute column
21 22 23 |
# File 'lib/idxfence/finding.rb', line 21 def column @column end |
#file ⇒ Object
Returns the value of attribute file
21 22 23 |
# File 'lib/idxfence/finding.rb', line 21 def file @file end |
#line ⇒ Object
Returns the value of attribute line
21 22 23 |
# File 'lib/idxfence/finding.rb', line 21 def line @line end |
#message ⇒ Object
Returns the value of attribute message
21 22 23 |
# File 'lib/idxfence/finding.rb', line 21 def @message end |
#model ⇒ Object
Returns the value of attribute model
21 22 23 |
# File 'lib/idxfence/finding.rb', line 21 def model @model end |
#scope ⇒ Object
Returns the value of attribute scope
21 22 23 |
# File 'lib/idxfence/finding.rb', line 21 def scope @scope end |
#table ⇒ Object
Returns the value of attribute table
21 22 23 |
# File 'lib/idxfence/finding.rb', line 21 def table @table end |
Instance Method Details
#to_h ⇒ Object
22 23 24 |
# File 'lib/idxfence/finding.rb', line 22 def to_h { code: code, model: model, table: table, column: column, scope: scope, file: file, line: line, message: } end |