active_record_doctor 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +41 -0
- data/lib/active_record_doctor/printers/io_printer.rb +6 -0
- data/lib/active_record_doctor/tasks/missing_foreign_keys.rb +69 -0
- data/lib/active_record_doctor/version.rb +1 -1
- data/lib/tasks/active_record_doctor_tasks.rake +5 -0
- data/test/active_record_doctor/tasks/missing_foreign_keys_test.rb +19 -0
- data/test/dummy/config/database.yml +5 -11
- data/test/dummy/config/database.yml.travis +5 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/{20160213102131_create_employers.rb → 20160213101213_create_employers.rb} +0 -0
- data/test/dummy/db/migrate/{20160213101213_create_users.rb → 20160213101221_create_users.rb} +1 -1
- data/test/dummy/db/schema.rb +13 -9
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +1006 -0
- data/test/dummy/log/test.log +3688 -0
- data/test/support/spy_printer.rb +7 -6
- metadata +14 -9
data/test/support/spy_printer.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
class SpyPrinter
|
2
|
-
attr_reader :unindexed_foreign_keys, :extraneous_indexes,
|
2
|
+
attr_reader :unindexed_foreign_keys, :extraneous_indexes,
|
3
|
+
:missing_foreign_keys
|
3
4
|
|
4
5
|
def initialize
|
5
6
|
@unindexed_foreign_keys = nil
|
6
7
|
@extraneous_indexes = nil
|
7
|
-
@
|
8
|
+
@missing_foreign_keys = nil
|
8
9
|
end
|
9
10
|
|
10
11
|
def print_unindexed_foreign_keys(argument)
|
@@ -23,11 +24,11 @@ class SpyPrinter
|
|
23
24
|
end
|
24
25
|
end
|
25
26
|
|
26
|
-
def
|
27
|
-
if @
|
28
|
-
fail("
|
27
|
+
def print_missing_foreign_keys(argument)
|
28
|
+
if @missing_foreign_keys
|
29
|
+
fail("print_missing_foreign_keys cannot be called twice")
|
29
30
|
else
|
30
|
-
@
|
31
|
+
@missing_foreign_keys = argument
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_doctor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Navis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -51,19 +51,19 @@ dependencies:
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '4.2'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
54
|
+
name: pg
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
59
|
+
version: '0.19'
|
60
60
|
type: :development
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
66
|
+
version: '0.19'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: rake
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- lib/active_record_doctor/railtie.rb
|
96
96
|
- lib/active_record_doctor/tasks.rb
|
97
97
|
- lib/active_record_doctor/tasks/extraneous_indexes.rb
|
98
|
+
- lib/active_record_doctor/tasks/missing_foreign_keys.rb
|
98
99
|
- lib/active_record_doctor/tasks/unindexed_foreign_keys.rb
|
99
100
|
- lib/active_record_doctor/version.rb
|
100
101
|
- lib/generators/active_record_doctor/add_indexes/USAGE
|
@@ -102,6 +103,7 @@ files:
|
|
102
103
|
- lib/tasks/active_record_doctor_tasks.rake
|
103
104
|
- test/active_record_doctor/printers/io_printer_test.rb
|
104
105
|
- test/active_record_doctor/tasks/extraneous_indexes_test.rb
|
106
|
+
- test/active_record_doctor/tasks/missing_foreign_keys_test.rb
|
105
107
|
- test/active_record_doctor/tasks/unindexed_foreign_keys_test.rb
|
106
108
|
- test/dummy/README.rdoc
|
107
109
|
- test/dummy/Rakefile
|
@@ -122,6 +124,7 @@ files:
|
|
122
124
|
- test/dummy/config/application.rb
|
123
125
|
- test/dummy/config/boot.rb
|
124
126
|
- test/dummy/config/database.yml
|
127
|
+
- test/dummy/config/database.yml.travis
|
125
128
|
- test/dummy/config/environment.rb
|
126
129
|
- test/dummy/config/environments/development.rb
|
127
130
|
- test/dummy/config/environments/production.rb
|
@@ -138,9 +141,9 @@ files:
|
|
138
141
|
- test/dummy/config/routes.rb
|
139
142
|
- test/dummy/config/secrets.yml
|
140
143
|
- test/dummy/db/development.sqlite3
|
141
|
-
- test/dummy/db/migrate/
|
144
|
+
- test/dummy/db/migrate/20160213101213_create_employers.rb
|
145
|
+
- test/dummy/db/migrate/20160213101221_create_users.rb
|
142
146
|
- test/dummy/db/migrate/20160213101232_create_profiles.rb
|
143
|
-
- test/dummy/db/migrate/20160213102131_create_employers.rb
|
144
147
|
- test/dummy/db/migrate/20160604081452_create_comments.rb
|
145
148
|
- test/dummy/db/schema.rb
|
146
149
|
- test/dummy/db/test.sqlite3
|
@@ -179,6 +182,7 @@ summary: A cure for your Active Record ailments.
|
|
179
182
|
test_files:
|
180
183
|
- test/test_helper.rb
|
181
184
|
- test/active_record_doctor/printers/io_printer_test.rb
|
185
|
+
- test/active_record_doctor/tasks/missing_foreign_keys_test.rb
|
182
186
|
- test/active_record_doctor/tasks/extraneous_indexes_test.rb
|
183
187
|
- test/active_record_doctor/tasks/unindexed_foreign_keys_test.rb
|
184
188
|
- test/dummy/README.rdoc
|
@@ -198,10 +202,10 @@ test_files:
|
|
198
202
|
- test/dummy/app/models/employer.rb
|
199
203
|
- test/dummy/app/models/user.rb
|
200
204
|
- test/dummy/db/schema.rb
|
205
|
+
- test/dummy/db/migrate/20160213101213_create_employers.rb
|
201
206
|
- test/dummy/db/migrate/20160604081452_create_comments.rb
|
202
|
-
- test/dummy/db/migrate/20160213102131_create_employers.rb
|
203
207
|
- test/dummy/db/migrate/20160213101232_create_profiles.rb
|
204
|
-
- test/dummy/db/migrate/
|
208
|
+
- test/dummy/db/migrate/20160213101221_create_users.rb
|
205
209
|
- test/dummy/db/development.sqlite3
|
206
210
|
- test/dummy/db/test.sqlite3
|
207
211
|
- test/dummy/public/404.html
|
@@ -214,6 +218,7 @@ test_files:
|
|
214
218
|
- test/dummy/config/environments/development.rb
|
215
219
|
- test/dummy/config/environments/test.rb
|
216
220
|
- test/dummy/config/environments/production.rb
|
221
|
+
- test/dummy/config/database.yml.travis
|
217
222
|
- test/dummy/config/environment.rb
|
218
223
|
- test/dummy/config/database.yml
|
219
224
|
- test/dummy/config/locales/en.yml
|