lol_dba 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/Gemfile.lock +86 -60
- data/README.md +1 -0
- data/Rakefile +0 -3
- data/lib/lol_dba.rb +8 -8
- data/lib/lol_dba/version.rb +2 -2
- data/lol_dba.gemspec +4 -4
- metadata +22 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9641b91bac129bd6c79d4283c72ecaa32dc2f1b
|
4
|
+
data.tar.gz: dcbdfafeb25f68cf9ed8b330994b148e60279d38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 865bc86214659eda2e6ad1b588d57904349ffa34af15c99b2b1baec6a1981b7ddce319a4d16d1cf2dd80c06ad5cfdcf0ead04b55e9b80bc44c1d7e212b127b1a
|
7
|
+
data.tar.gz: 6364656d074e6e2029d7fc62658d76026b26258ac3274f12183f291394e2e52e48da751c24d5d85bf881032fb51ed59d048d782dfac5f1d1f8299872d6a7c691
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,91 +1,117 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actionmailer (4.
|
5
|
-
actionpack (= 4.
|
6
|
-
actionview (= 4.
|
4
|
+
actionmailer (4.2.0)
|
5
|
+
actionpack (= 4.2.0)
|
6
|
+
actionview (= 4.2.0)
|
7
|
+
activejob (= 4.2.0)
|
7
8
|
mail (~> 2.5, >= 2.5.4)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
10
|
+
actionpack (4.2.0)
|
11
|
+
actionview (= 4.2.0)
|
12
|
+
activesupport (= 4.2.0)
|
13
|
+
rack (~> 1.6.0)
|
12
14
|
rack-test (~> 0.6.2)
|
13
|
-
|
14
|
-
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
17
|
+
actionview (4.2.0)
|
18
|
+
activesupport (= 4.2.0)
|
15
19
|
builder (~> 3.1)
|
16
20
|
erubis (~> 2.7.0)
|
17
|
-
|
18
|
-
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
23
|
+
activejob (4.2.0)
|
24
|
+
activesupport (= 4.2.0)
|
25
|
+
globalid (>= 0.3.0)
|
26
|
+
activemodel (4.2.0)
|
27
|
+
activesupport (= 4.2.0)
|
19
28
|
builder (~> 3.1)
|
20
|
-
activerecord (4.
|
21
|
-
activemodel (= 4.
|
22
|
-
activesupport (= 4.
|
23
|
-
arel (~>
|
24
|
-
activesupport (4.
|
25
|
-
i18n (~> 0.
|
29
|
+
activerecord (4.2.0)
|
30
|
+
activemodel (= 4.2.0)
|
31
|
+
activesupport (= 4.2.0)
|
32
|
+
arel (~> 6.0)
|
33
|
+
activesupport (4.2.0)
|
34
|
+
i18n (~> 0.7)
|
26
35
|
json (~> 1.7, >= 1.7.7)
|
27
36
|
minitest (~> 5.1)
|
28
|
-
thread_safe (~> 0.
|
37
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
29
38
|
tzinfo (~> 1.1)
|
30
|
-
arel (
|
39
|
+
arel (6.0.0)
|
31
40
|
builder (3.2.2)
|
32
41
|
diff-lcs (1.2.5)
|
33
42
|
erubis (2.7.0)
|
43
|
+
globalid (0.3.3)
|
44
|
+
activesupport (>= 4.1.0)
|
34
45
|
hike (1.2.3)
|
35
|
-
i18n (0.
|
36
|
-
json (1.8.
|
37
|
-
|
46
|
+
i18n (0.7.0)
|
47
|
+
json (1.8.2)
|
48
|
+
loofah (2.0.1)
|
49
|
+
nokogiri (>= 1.5.9)
|
50
|
+
mail (2.6.3)
|
38
51
|
mime-types (>= 1.16, < 3)
|
39
|
-
mime-types (2.3)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
52
|
+
mime-types (2.4.3)
|
53
|
+
mini_portile (0.6.2)
|
54
|
+
minitest (5.5.1)
|
55
|
+
multi_json (1.11.0)
|
56
|
+
nokogiri (1.6.6.2)
|
57
|
+
mini_portile (~> 0.6.0)
|
58
|
+
rack (1.6.0)
|
59
|
+
rack-test (0.6.3)
|
44
60
|
rack (>= 1.0)
|
45
|
-
rails (4.
|
46
|
-
actionmailer (= 4.
|
47
|
-
actionpack (= 4.
|
48
|
-
actionview (= 4.
|
49
|
-
|
50
|
-
|
51
|
-
|
61
|
+
rails (4.2.0)
|
62
|
+
actionmailer (= 4.2.0)
|
63
|
+
actionpack (= 4.2.0)
|
64
|
+
actionview (= 4.2.0)
|
65
|
+
activejob (= 4.2.0)
|
66
|
+
activemodel (= 4.2.0)
|
67
|
+
activerecord (= 4.2.0)
|
68
|
+
activesupport (= 4.2.0)
|
52
69
|
bundler (>= 1.3.0, < 2.0)
|
53
|
-
railties (= 4.
|
54
|
-
sprockets-rails
|
55
|
-
|
56
|
-
|
57
|
-
|
70
|
+
railties (= 4.2.0)
|
71
|
+
sprockets-rails
|
72
|
+
rails-deprecated_sanitizer (1.0.3)
|
73
|
+
activesupport (>= 4.2.0.alpha)
|
74
|
+
rails-dom-testing (1.0.5)
|
75
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
76
|
+
nokogiri (~> 1.6.0)
|
77
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
78
|
+
rails-html-sanitizer (1.0.2)
|
79
|
+
loofah (~> 2.0)
|
80
|
+
railties (4.2.0)
|
81
|
+
actionpack (= 4.2.0)
|
82
|
+
activesupport (= 4.2.0)
|
58
83
|
rake (>= 0.8.7)
|
59
84
|
thor (>= 0.18.1, < 2.0)
|
60
|
-
rake (10.
|
61
|
-
rspec-core (3.
|
62
|
-
rspec-support (~> 3.
|
63
|
-
rspec-expectations (3.
|
85
|
+
rake (10.4.2)
|
86
|
+
rspec-core (3.2.2)
|
87
|
+
rspec-support (~> 3.2.0)
|
88
|
+
rspec-expectations (3.2.0)
|
64
89
|
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
-
rspec-support (~> 3.
|
66
|
-
rspec-mocks (3.
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
rspec-
|
74
|
-
rspec-
|
75
|
-
rspec-
|
76
|
-
|
77
|
-
|
90
|
+
rspec-support (~> 3.2.0)
|
91
|
+
rspec-mocks (3.2.1)
|
92
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
93
|
+
rspec-support (~> 3.2.0)
|
94
|
+
rspec-rails (3.2.1)
|
95
|
+
actionpack (>= 3.0, < 4.3)
|
96
|
+
activesupport (>= 3.0, < 4.3)
|
97
|
+
railties (>= 3.0, < 4.3)
|
98
|
+
rspec-core (~> 3.2.0)
|
99
|
+
rspec-expectations (~> 3.2.0)
|
100
|
+
rspec-mocks (~> 3.2.0)
|
101
|
+
rspec-support (~> 3.2.0)
|
102
|
+
rspec-support (3.2.2)
|
103
|
+
sprockets (2.12.3)
|
78
104
|
hike (~> 1.2)
|
79
105
|
multi_json (~> 1.0)
|
80
106
|
rack (~> 1.0)
|
81
107
|
tilt (~> 1.1, != 1.3.0)
|
82
|
-
sprockets-rails (2.
|
108
|
+
sprockets-rails (2.2.4)
|
83
109
|
actionpack (>= 3.0)
|
84
110
|
activesupport (>= 3.0)
|
85
|
-
sprockets (
|
86
|
-
sqlite3 (1.3.
|
111
|
+
sprockets (>= 2.8, < 4.0)
|
112
|
+
sqlite3 (1.3.10)
|
87
113
|
thor (0.19.1)
|
88
|
-
thread_safe (0.3.
|
114
|
+
thread_safe (0.3.5)
|
89
115
|
tilt (1.4.1)
|
90
116
|
tzinfo (1.2.2)
|
91
117
|
thread_safe (~> 0.1)
|
data/README.md
CHANGED
@@ -74,6 +74,7 @@ All feedback, bug reports and thoughts on this gratefully received.
|
|
74
74
|
* [Adrian Hooper](https://twitter.com/PaReeOhNos)
|
75
75
|
* [Ray Zane](https://github.com/rzane)
|
76
76
|
* [Grant Gongaware](https://github.com/ggongaware)
|
77
|
+
* [Philipp Weissensteiner](http://philippweissensteiner.com)
|
77
78
|
|
78
79
|
### License
|
79
80
|
|
data/Rakefile
CHANGED
data/lib/lol_dba.rb
CHANGED
@@ -18,9 +18,9 @@ EOM
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.get_through_foreign_key(target_class, reflection_options)
|
21
|
-
if target_class.reflections[reflection_options.options[:through]]
|
21
|
+
if target_class.reflections[reflection_options.options[:through].to_s]
|
22
22
|
# has_many :through
|
23
|
-
reflection = target_class.reflections[reflection_options.options[:through]]
|
23
|
+
reflection = target_class.reflections[reflection_options.options[:through].to_s]
|
24
24
|
else
|
25
25
|
# has_and_belongs_to_many
|
26
26
|
reflection = reflection_options
|
@@ -117,18 +117,17 @@ EOM
|
|
117
117
|
when :has_many
|
118
118
|
# has_many tables are threaten by the other side of the relation
|
119
119
|
next unless reflection_options.options[:through]
|
120
|
-
|
121
|
-
through_class = class_name.reflections[reflection_options.options[:through]].klass
|
120
|
+
through_class = class_name.reflections[reflection_options.options[:through].to_s].klass
|
122
121
|
table_name = through_class.table_name
|
123
122
|
|
124
123
|
foreign_key = get_through_foreign_key(class_name, reflection_options)
|
125
124
|
|
126
125
|
if reflection_options.options[:source]
|
127
|
-
association_class = through_class.reflections[reflection_options.options[:source]].klass
|
126
|
+
association_class = through_class.reflections[reflection_options.options[:source].to_s].klass
|
128
127
|
association_foreign_key = get_through_foreign_key(association_class, reflection_options)
|
129
128
|
else
|
130
129
|
# go to joining model through has_many and find belongs_to
|
131
|
-
blg_to_reflection = class_name.reflections[reflection_options.options[:through]]
|
130
|
+
blg_to_reflection = class_name.reflections[reflection_options.options[:through].to_s]
|
132
131
|
if blg_to_reflection.options[:class_name]
|
133
132
|
# has_many :class_name
|
134
133
|
blg_to_class = blg_to_reflection.options[:class_name].constantize
|
@@ -138,10 +137,11 @@ EOM
|
|
138
137
|
end
|
139
138
|
|
140
139
|
#multiple level :through relation, can be ignored for now(it will be checked in the right relation)
|
141
|
-
next if blg_to_class.reflections[reflection_name.to_s.singularize.
|
140
|
+
next if blg_to_class.reflections[reflection_name.to_s.singularize.to_s].nil?
|
141
|
+
|
142
142
|
|
143
143
|
# get foreign_key from belongs_to
|
144
|
-
association_foreign_key = blg_to_class.reflections[reflection_name.to_s.singularize.
|
144
|
+
association_foreign_key = blg_to_class.reflections[reflection_name.to_s.singularize.to_s].options[:foreign_key]
|
145
145
|
end
|
146
146
|
|
147
147
|
#FIXME currently we don't support :through => :another_regular_has_many_and_non_through_relation
|
data/lib/lol_dba/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module LolDba
|
2
|
-
VERSION = "1.6.
|
3
|
-
end
|
2
|
+
VERSION = "1.6.5" unless defined? LolDba::VERSION
|
3
|
+
end
|
data/lol_dba.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
19
|
s.require_paths = ["lib", "lib/lol_dba"]
|
20
20
|
|
21
|
-
s.required_ruby_version = ">=
|
22
|
-
s.add_dependency "activerecord", ">= 3.0"
|
23
|
-
s.add_dependency "actionpack", ">= 3.0"
|
24
|
-
s.add_dependency "railties", ">= 3.0"
|
21
|
+
s.required_ruby_version = ">= 2.0.0"
|
22
|
+
s.add_dependency "activerecord", ">= 3.0", "< 5.0"
|
23
|
+
s.add_dependency "actionpack", ">= 3.0", "< 5.0"
|
24
|
+
s.add_dependency "railties", ">= 3.0", "< 5.0"
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lol_dba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Plentz
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activerecord
|
@@ -21,6 +21,9 @@ dependencies:
|
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '3.0'
|
24
|
+
- - "<"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.0'
|
24
27
|
type: :runtime
|
25
28
|
prerelease: false
|
26
29
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -28,6 +31,9 @@ dependencies:
|
|
28
31
|
- - ">="
|
29
32
|
- !ruby/object:Gem::Version
|
30
33
|
version: '3.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '5.0'
|
31
37
|
- !ruby/object:Gem::Dependency
|
32
38
|
name: actionpack
|
33
39
|
requirement: !ruby/object:Gem::Requirement
|
@@ -35,6 +41,9 @@ dependencies:
|
|
35
41
|
- - ">="
|
36
42
|
- !ruby/object:Gem::Version
|
37
43
|
version: '3.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '5.0'
|
38
47
|
type: :runtime
|
39
48
|
prerelease: false
|
40
49
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,6 +51,9 @@ dependencies:
|
|
42
51
|
- - ">="
|
43
52
|
- !ruby/object:Gem::Version
|
44
53
|
version: '3.0'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '5.0'
|
45
57
|
- !ruby/object:Gem::Dependency
|
46
58
|
name: railties
|
47
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -49,6 +61,9 @@ dependencies:
|
|
49
61
|
- - ">="
|
50
62
|
- !ruby/object:Gem::Version
|
51
63
|
version: '3.0'
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '5.0'
|
52
67
|
type: :runtime
|
53
68
|
prerelease: false
|
54
69
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -56,6 +71,9 @@ dependencies:
|
|
56
71
|
- - ">="
|
57
72
|
- !ruby/object:Gem::Version
|
58
73
|
version: '3.0'
|
74
|
+
- - "<"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '5.0'
|
59
77
|
description: lol_dba is a small package of rake tasks that scan your application models
|
60
78
|
and displays a list of columns that probably should be indexed. Also, it can generate
|
61
79
|
.sql migration scripts.
|
@@ -116,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
134
|
requirements:
|
117
135
|
- - ">="
|
118
136
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
137
|
+
version: 2.0.0
|
120
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
139
|
requirements:
|
122
140
|
- - ">="
|
@@ -124,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
142
|
version: '0'
|
125
143
|
requirements: []
|
126
144
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
145
|
+
rubygems_version: 2.4.6
|
128
146
|
signing_key:
|
129
147
|
specification_version: 4
|
130
148
|
summary: A small package of rake tasks to track down missing database indexes and
|