idxfence 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/DETAILS.md +293 -0
- data/Gemfile +3 -0
- data/LICENSE +21 -0
- data/README.md +95 -0
- data/docs/USAGE.md +107 -0
- data/examples/app/models/membership.rb +8 -0
- data/examples/app/models/user.rb +11 -0
- data/examples/db/schema.rb +26 -0
- data/exe/idxfence +7 -0
- data/idxfence.gemspec +39 -0
- data/lib/idxfence/checker.rb +81 -0
- data/lib/idxfence/cli.rb +64 -0
- data/lib/idxfence/finding.rb +26 -0
- data/lib/idxfence/inflector.rb +69 -0
- data/lib/idxfence/model_parser.rb +219 -0
- data/lib/idxfence/render.rb +28 -0
- data/lib/idxfence/schema_parser.rb +127 -0
- data/lib/idxfence/version.rb +3 -0
- data/lib/idxfence.rb +40 -0
- metadata +91 -0
metadata
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: idxfence
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jay
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-09-24 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rspec
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '3.13'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '3.13'
|
|
27
|
+
description: |
|
|
28
|
+
idxfence cross-references every `validates :column, uniqueness: true`
|
|
29
|
+
/ `uniqueness: { scope: ... }` / `validates_uniqueness_of` declaration
|
|
30
|
+
in app/models/*.rb against db/schema.rb's create_table blocks, and
|
|
31
|
+
flags any whose column set (including scope columns) has no matching
|
|
32
|
+
`t.index [...], unique: true`. An ActiveRecord uniqueness validation
|
|
33
|
+
only performs a SELECT ... WHERE check at the application layer
|
|
34
|
+
before an INSERT -- under real concurrency, two requests can both
|
|
35
|
+
pass that check before either commits, landing a genuine duplicate
|
|
36
|
+
row despite the validation "working." Rails Guides themselves
|
|
37
|
+
document this exact race and recommend a matching DB-level unique
|
|
38
|
+
index as the only real fix; plenty of real apps ship with only the
|
|
39
|
+
AR-level check.
|
|
40
|
+
email:
|
|
41
|
+
executables:
|
|
42
|
+
- idxfence
|
|
43
|
+
extensions: []
|
|
44
|
+
extra_rdoc_files: []
|
|
45
|
+
files:
|
|
46
|
+
- DETAILS.md
|
|
47
|
+
- Gemfile
|
|
48
|
+
- LICENSE
|
|
49
|
+
- README.md
|
|
50
|
+
- docs/USAGE.md
|
|
51
|
+
- examples/app/models/membership.rb
|
|
52
|
+
- examples/app/models/user.rb
|
|
53
|
+
- examples/db/schema.rb
|
|
54
|
+
- exe/idxfence
|
|
55
|
+
- idxfence.gemspec
|
|
56
|
+
- lib/idxfence.rb
|
|
57
|
+
- lib/idxfence/checker.rb
|
|
58
|
+
- lib/idxfence/cli.rb
|
|
59
|
+
- lib/idxfence/finding.rb
|
|
60
|
+
- lib/idxfence/inflector.rb
|
|
61
|
+
- lib/idxfence/model_parser.rb
|
|
62
|
+
- lib/idxfence/render.rb
|
|
63
|
+
- lib/idxfence/schema_parser.rb
|
|
64
|
+
- lib/idxfence/version.rb
|
|
65
|
+
homepage: https://github.com/jay-tank/idxfence
|
|
66
|
+
licenses:
|
|
67
|
+
- MIT
|
|
68
|
+
metadata:
|
|
69
|
+
homepage_uri: https://github.com/jay-tank/idxfence
|
|
70
|
+
source_code_uri: https://github.com/jay-tank/idxfence
|
|
71
|
+
post_install_message:
|
|
72
|
+
rdoc_options: []
|
|
73
|
+
require_paths:
|
|
74
|
+
- lib
|
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
|
+
requirements:
|
|
77
|
+
- - ">="
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: 3.0.0
|
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
|
+
requirements:
|
|
82
|
+
- - ">="
|
|
83
|
+
- !ruby/object:Gem::Version
|
|
84
|
+
version: '0'
|
|
85
|
+
requirements: []
|
|
86
|
+
rubygems_version: 3.3.5
|
|
87
|
+
signing_key:
|
|
88
|
+
specification_version: 4
|
|
89
|
+
summary: 'Flags Rails ActiveRecord uniqueness: true validations with no matching DB-level
|
|
90
|
+
unique index in db/schema.rb.'
|
|
91
|
+
test_files: []
|