lol_dba 2.0.0 → 2.0.1
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 +4 -4
- data/Gemfile.lock +61 -64
- data/README.md +2 -0
- data/gemfiles/rails_3_2.gemfile.lock +1 -1
- data/gemfiles/rails_4_0.gemfile.lock +1 -1
- data/gemfiles/rails_4_1.gemfile.lock +1 -1
- data/gemfiles/rails_4_2.gemfile.lock +1 -1
- data/lib/lol_dba.rb +5 -5
- data/lib/lol_dba/version.rb +1 -1
- data/spec/fixtures/app/models/component.rb +3 -0
- data/spec/fixtures/app/models/group.rb +4 -0
- data/spec/fixtures/app/models/group_component.rb +4 -0
- data/spec/fixtures/schema.rb +14 -1
- metadata +9 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f58898cf4d34daf83b52dbf1329aacfa7ea1531
|
|
4
|
+
data.tar.gz: a04f250fa27a24a68958f2393f4ff9344ddf73ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 102dfb9b0aa89fbc7829579f98aef6faf4371a971b5dfc1c2bd493871977ddab2567935a89aec59d908e85513f0dfd1bffd8e308d4b32740fb578f5e28b4dac3
|
|
7
|
+
data.tar.gz: c17fa9267d528fa442d3144a60efaaa6b906c6c6d2098fed54c60209db25642a2aa8e1b925c3892625c000a2afe205912dd13b9c7de4a3b80daf2b66bccb47e8
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
lol_dba (
|
|
4
|
+
lol_dba (2.0.0)
|
|
5
5
|
actionpack (>= 3.0, < 5.0)
|
|
6
6
|
activerecord (>= 3.0, < 5.0)
|
|
7
7
|
railties (>= 3.0, < 5.0)
|
|
@@ -9,36 +9,36 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
actionmailer (4.2.
|
|
13
|
-
actionpack (= 4.2.
|
|
14
|
-
actionview (= 4.2.
|
|
15
|
-
activejob (= 4.2.
|
|
12
|
+
actionmailer (4.2.4)
|
|
13
|
+
actionpack (= 4.2.4)
|
|
14
|
+
actionview (= 4.2.4)
|
|
15
|
+
activejob (= 4.2.4)
|
|
16
16
|
mail (~> 2.5, >= 2.5.4)
|
|
17
17
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
18
|
-
actionpack (4.2.
|
|
19
|
-
actionview (= 4.2.
|
|
20
|
-
activesupport (= 4.2.
|
|
18
|
+
actionpack (4.2.4)
|
|
19
|
+
actionview (= 4.2.4)
|
|
20
|
+
activesupport (= 4.2.4)
|
|
21
21
|
rack (~> 1.6)
|
|
22
22
|
rack-test (~> 0.6.2)
|
|
23
23
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
24
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
|
25
|
-
actionview (4.2.
|
|
26
|
-
activesupport (= 4.2.
|
|
24
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
25
|
+
actionview (4.2.4)
|
|
26
|
+
activesupport (= 4.2.4)
|
|
27
27
|
builder (~> 3.1)
|
|
28
28
|
erubis (~> 2.7.0)
|
|
29
29
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
30
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
|
31
|
-
activejob (4.2.
|
|
32
|
-
activesupport (= 4.2.
|
|
30
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
31
|
+
activejob (4.2.4)
|
|
32
|
+
activesupport (= 4.2.4)
|
|
33
33
|
globalid (>= 0.3.0)
|
|
34
|
-
activemodel (4.2.
|
|
35
|
-
activesupport (= 4.2.
|
|
34
|
+
activemodel (4.2.4)
|
|
35
|
+
activesupport (= 4.2.4)
|
|
36
36
|
builder (~> 3.1)
|
|
37
|
-
activerecord (4.2.
|
|
38
|
-
activemodel (= 4.2.
|
|
39
|
-
activesupport (= 4.2.
|
|
37
|
+
activerecord (4.2.4)
|
|
38
|
+
activemodel (= 4.2.4)
|
|
39
|
+
activesupport (= 4.2.4)
|
|
40
40
|
arel (~> 6.0)
|
|
41
|
-
activesupport (4.2.
|
|
41
|
+
activesupport (4.2.4)
|
|
42
42
|
i18n (~> 0.7)
|
|
43
43
|
json (~> 1.7, >= 1.7.7)
|
|
44
44
|
minitest (~> 5.1)
|
|
@@ -48,86 +48,80 @@ GEM
|
|
|
48
48
|
bundler
|
|
49
49
|
rake
|
|
50
50
|
thor (>= 0.14.0)
|
|
51
|
-
arel (6.0.
|
|
51
|
+
arel (6.0.3)
|
|
52
52
|
builder (3.2.2)
|
|
53
53
|
diff-lcs (1.2.5)
|
|
54
54
|
erubis (2.7.0)
|
|
55
|
-
globalid (0.3.
|
|
55
|
+
globalid (0.3.6)
|
|
56
56
|
activesupport (>= 4.1.0)
|
|
57
|
-
hike (1.2.3)
|
|
58
57
|
i18n (0.7.0)
|
|
59
|
-
json (1.8.
|
|
60
|
-
loofah (2.0.
|
|
58
|
+
json (1.8.3)
|
|
59
|
+
loofah (2.0.3)
|
|
61
60
|
nokogiri (>= 1.5.9)
|
|
62
61
|
mail (2.6.3)
|
|
63
62
|
mime-types (>= 1.16, < 3)
|
|
64
|
-
mime-types (2.
|
|
63
|
+
mime-types (2.6.2)
|
|
65
64
|
mini_portile (0.6.2)
|
|
66
|
-
minitest (5.
|
|
67
|
-
multi_json (1.11.0)
|
|
65
|
+
minitest (5.8.1)
|
|
68
66
|
nokogiri (1.6.6.2)
|
|
69
67
|
mini_portile (~> 0.6.0)
|
|
70
|
-
power_assert (0.2.
|
|
71
|
-
rack (1.6.
|
|
68
|
+
power_assert (0.2.4)
|
|
69
|
+
rack (1.6.4)
|
|
72
70
|
rack-test (0.6.3)
|
|
73
71
|
rack (>= 1.0)
|
|
74
|
-
rails (4.2.
|
|
75
|
-
actionmailer (= 4.2.
|
|
76
|
-
actionpack (= 4.2.
|
|
77
|
-
actionview (= 4.2.
|
|
78
|
-
activejob (= 4.2.
|
|
79
|
-
activemodel (= 4.2.
|
|
80
|
-
activerecord (= 4.2.
|
|
81
|
-
activesupport (= 4.2.
|
|
72
|
+
rails (4.2.4)
|
|
73
|
+
actionmailer (= 4.2.4)
|
|
74
|
+
actionpack (= 4.2.4)
|
|
75
|
+
actionview (= 4.2.4)
|
|
76
|
+
activejob (= 4.2.4)
|
|
77
|
+
activemodel (= 4.2.4)
|
|
78
|
+
activerecord (= 4.2.4)
|
|
79
|
+
activesupport (= 4.2.4)
|
|
82
80
|
bundler (>= 1.3.0, < 2.0)
|
|
83
|
-
railties (= 4.2.
|
|
81
|
+
railties (= 4.2.4)
|
|
84
82
|
sprockets-rails
|
|
85
83
|
rails-deprecated_sanitizer (1.0.3)
|
|
86
84
|
activesupport (>= 4.2.0.alpha)
|
|
87
|
-
rails-dom-testing (1.0.
|
|
85
|
+
rails-dom-testing (1.0.7)
|
|
88
86
|
activesupport (>= 4.2.0.beta, < 5.0)
|
|
89
87
|
nokogiri (~> 1.6.0)
|
|
90
88
|
rails-deprecated_sanitizer (>= 1.0.1)
|
|
91
89
|
rails-html-sanitizer (1.0.2)
|
|
92
90
|
loofah (~> 2.0)
|
|
93
|
-
railties (4.2.
|
|
94
|
-
actionpack (= 4.2.
|
|
95
|
-
activesupport (= 4.2.
|
|
91
|
+
railties (4.2.4)
|
|
92
|
+
actionpack (= 4.2.4)
|
|
93
|
+
activesupport (= 4.2.4)
|
|
96
94
|
rake (>= 0.8.7)
|
|
97
95
|
thor (>= 0.18.1, < 2.0)
|
|
98
96
|
rake (10.4.2)
|
|
99
|
-
rspec-core (3.
|
|
100
|
-
rspec-support (~> 3.
|
|
101
|
-
rspec-expectations (3.
|
|
97
|
+
rspec-core (3.3.2)
|
|
98
|
+
rspec-support (~> 3.3.0)
|
|
99
|
+
rspec-expectations (3.3.1)
|
|
102
100
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
103
|
-
rspec-support (~> 3.
|
|
104
|
-
rspec-mocks (3.2
|
|
101
|
+
rspec-support (~> 3.3.0)
|
|
102
|
+
rspec-mocks (3.3.2)
|
|
105
103
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
106
|
-
rspec-support (~> 3.
|
|
107
|
-
rspec-rails (3.
|
|
104
|
+
rspec-support (~> 3.3.0)
|
|
105
|
+
rspec-rails (3.3.3)
|
|
108
106
|
actionpack (>= 3.0, < 4.3)
|
|
109
107
|
activesupport (>= 3.0, < 4.3)
|
|
110
108
|
railties (>= 3.0, < 4.3)
|
|
111
|
-
rspec-core (~> 3.
|
|
112
|
-
rspec-expectations (~> 3.
|
|
113
|
-
rspec-mocks (~> 3.
|
|
114
|
-
rspec-support (~> 3.
|
|
115
|
-
rspec-support (3.
|
|
116
|
-
sprockets (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
rack (~> 1.0)
|
|
120
|
-
tilt (~> 1.1, != 1.3.0)
|
|
121
|
-
sprockets-rails (2.2.4)
|
|
109
|
+
rspec-core (~> 3.3.0)
|
|
110
|
+
rspec-expectations (~> 3.3.0)
|
|
111
|
+
rspec-mocks (~> 3.3.0)
|
|
112
|
+
rspec-support (~> 3.3.0)
|
|
113
|
+
rspec-support (3.3.0)
|
|
114
|
+
sprockets (3.4.0)
|
|
115
|
+
rack (> 1, < 3)
|
|
116
|
+
sprockets-rails (2.3.3)
|
|
122
117
|
actionpack (>= 3.0)
|
|
123
118
|
activesupport (>= 3.0)
|
|
124
119
|
sprockets (>= 2.8, < 4.0)
|
|
125
|
-
sqlite3 (1.3.
|
|
126
|
-
test-unit (3.
|
|
120
|
+
sqlite3 (1.3.11)
|
|
121
|
+
test-unit (3.1.5)
|
|
127
122
|
power_assert
|
|
128
123
|
thor (0.19.1)
|
|
129
124
|
thread_safe (0.3.5)
|
|
130
|
-
tilt (1.4.1)
|
|
131
125
|
tzinfo (1.2.2)
|
|
132
126
|
thread_safe (~> 0.1)
|
|
133
127
|
|
|
@@ -141,3 +135,6 @@ DEPENDENCIES
|
|
|
141
135
|
rspec-rails
|
|
142
136
|
sqlite3
|
|
143
137
|
test-unit
|
|
138
|
+
|
|
139
|
+
BUNDLED WITH
|
|
140
|
+
1.10.6
|
data/README.md
CHANGED
|
@@ -78,6 +78,8 @@ All feedback, bug reports and thoughts on this gratefully received.
|
|
|
78
78
|
* [Philipp Weissensteiner](http://philippweissensteiner.com)
|
|
79
79
|
* [Leung Ho Kuen](https://twitter.com/PikachuEXE)
|
|
80
80
|
* [Lucas Mazza](https://twitter.com/lucasmazza)
|
|
81
|
+
* [Larry Reaves](https://github.com/yrral86)
|
|
82
|
+
* [James Bowles](https://github.com/jamesbowles)
|
|
81
83
|
|
|
82
84
|
### License
|
|
83
85
|
|
data/lib/lol_dba.rb
CHANGED
|
@@ -115,18 +115,18 @@ EOM
|
|
|
115
115
|
index_name = [association_foreign_key, foreign_key].sort
|
|
116
116
|
when :has_many
|
|
117
117
|
# has_many tables are threaten by the other side of the relation
|
|
118
|
-
next unless reflection_options.options[:through]
|
|
118
|
+
next unless reflection_options.options[:through] && reflections[reflection_options.options[:through].to_s]
|
|
119
119
|
through_class = reflections[reflection_options.options[:through].to_s].klass
|
|
120
120
|
table_name = through_class.table_name
|
|
121
121
|
|
|
122
122
|
foreign_key = get_through_foreign_key(class_name, reflection_options)
|
|
123
123
|
|
|
124
|
-
if reflection_options.options[:source]
|
|
125
|
-
association_class = through_class.reflections.stringify_keys[
|
|
124
|
+
if source = reflection_options.options[:source]
|
|
125
|
+
association_class = through_class.reflections.stringify_keys[source.to_s].klass
|
|
126
126
|
association_foreign_key = get_through_foreign_key(association_class, reflection_options)
|
|
127
|
-
|
|
127
|
+
elsif through_reflections = through_class.reflections.stringify_keys[reflection_name.singularize]
|
|
128
128
|
# go to joining model through has_many and find belongs_to
|
|
129
|
-
association_foreign_key =
|
|
129
|
+
association_foreign_key = through_reflections.options[:foreign_key]
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
#FIXME currently we don't support :through => :another_regular_has_many_and_non_through_relation
|
data/lib/lol_dba/version.rb
CHANGED
data/spec/fixtures/schema.rb
CHANGED
|
@@ -66,4 +66,17 @@ ActiveRecord::Schema.define do
|
|
|
66
66
|
create_table "countries", :force => true do |t|
|
|
67
67
|
t.column "name", :string
|
|
68
68
|
end
|
|
69
|
-
|
|
69
|
+
|
|
70
|
+
create_table "components", force: :cascade do |t|
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
create_table "group_components", force: :cascade do |t|
|
|
74
|
+
t.column "group_id", :integer
|
|
75
|
+
t.column "component_id", :integer
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
create_table "groups", force: :cascade do |t|
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
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: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
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: 2015-
|
|
15
|
+
date: 2015-10-24 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: activerecord
|
|
@@ -133,10 +133,13 @@ files:
|
|
|
133
133
|
- spec/fixtures/app/models/company.rb
|
|
134
134
|
- spec/fixtures/app/models/complex_billable_week.rb
|
|
135
135
|
- spec/fixtures/app/models/complex_timesheet.rb
|
|
136
|
+
- spec/fixtures/app/models/component.rb
|
|
136
137
|
- spec/fixtures/app/models/country.rb
|
|
137
138
|
- spec/fixtures/app/models/freelancer.rb
|
|
138
139
|
- spec/fixtures/app/models/gift.rb
|
|
139
140
|
- spec/fixtures/app/models/god.rb
|
|
141
|
+
- spec/fixtures/app/models/group.rb
|
|
142
|
+
- spec/fixtures/app/models/group_component.rb
|
|
140
143
|
- spec/fixtures/app/models/timesheet.rb
|
|
141
144
|
- spec/fixtures/app/models/user.rb
|
|
142
145
|
- spec/fixtures/app/models/worker.rb
|
|
@@ -165,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
165
168
|
version: '0'
|
|
166
169
|
requirements: []
|
|
167
170
|
rubyforge_project:
|
|
168
|
-
rubygems_version: 2.4.
|
|
171
|
+
rubygems_version: 2.4.8
|
|
169
172
|
signing_key:
|
|
170
173
|
specification_version: 4
|
|
171
174
|
summary: A small package of rake tasks to track down missing database indexes and
|
|
@@ -178,10 +181,13 @@ test_files:
|
|
|
178
181
|
- spec/fixtures/app/models/company.rb
|
|
179
182
|
- spec/fixtures/app/models/complex_billable_week.rb
|
|
180
183
|
- spec/fixtures/app/models/complex_timesheet.rb
|
|
184
|
+
- spec/fixtures/app/models/component.rb
|
|
181
185
|
- spec/fixtures/app/models/country.rb
|
|
182
186
|
- spec/fixtures/app/models/freelancer.rb
|
|
183
187
|
- spec/fixtures/app/models/gift.rb
|
|
184
188
|
- spec/fixtures/app/models/god.rb
|
|
189
|
+
- spec/fixtures/app/models/group.rb
|
|
190
|
+
- spec/fixtures/app/models/group_component.rb
|
|
185
191
|
- spec/fixtures/app/models/timesheet.rb
|
|
186
192
|
- spec/fixtures/app/models/user.rb
|
|
187
193
|
- spec/fixtures/app/models/worker.rb
|