lol_dba 2.0.1 → 2.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f58898cf4d34daf83b52dbf1329aacfa7ea1531
4
- data.tar.gz: a04f250fa27a24a68958f2393f4ff9344ddf73ab
3
+ metadata.gz: 127607540ae57344883d9c76e7e1e10c5836dbf3
4
+ data.tar.gz: a631d43dda31a21ff819c3208d5dcdca73150688
5
5
  SHA512:
6
- metadata.gz: 102dfb9b0aa89fbc7829579f98aef6faf4371a971b5dfc1c2bd493871977ddab2567935a89aec59d908e85513f0dfd1bffd8e308d4b32740fb578f5e28b4dac3
7
- data.tar.gz: c17fa9267d528fa442d3144a60efaaa6b906c6c6d2098fed54c60209db25642a2aa8e1b925c3892625c000a2afe205912dd13b9c7de4a3b80daf2b66bccb47e8
6
+ metadata.gz: 2bd6d5626b9678f4cfb927c596d9534f8d689efad7a617d9b8dbf23f1c7ed39043ab0d07c28245c70a05f2184c35191748d5a9869d2a4e2965c46b5e1f01a825
7
+ data.tar.gz: dd27d0ec2de737b8c3d718a7304a0643715d43f2a59d361d2b2a450de16f68d71edf5eaf4f8f8589ff32abcd4199eaf4bbf0840b0532e113193e65ca38616e41
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lol_dba (2.0.0)
4
+ lol_dba (2.0.1)
5
5
  actionpack (>= 3.0, < 5.0)
6
6
  activerecord (>= 3.0, < 5.0)
7
7
  railties (>= 3.0, < 5.0)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  #lol_dba [![travis](https://api.travis-ci.org/plentz/lol_dba.png?branch=master)](https://travis-ci.org/plentz/lol_dba)
2
2
 
3
- lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts. Most of the code come from rails_indexes and migration_sql_generator.
3
+ lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts. Most of the initial code came from [rails_indexes](https://github.com/warpc/rails_indexes) and [migration_sql_generator](https://github.com/muness/migration_sql_generator).
4
4
 
5
5
  ### Quick example
6
6
 
@@ -41,7 +41,7 @@ Use it the same way you use other rake commands
41
41
 
42
42
  ### Compatibility
43
43
 
44
- Compatible with Ruby 2.x and Rails 3.x, 4.x.
44
+ Compatible with Ruby 2.x and Rails 3.x, 4.x, 5.x.
45
45
 
46
46
  ### About primary_key
47
47
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- lol_dba (2.0.0)
4
+ lol_dba (2.0.1)
5
5
  actionpack (>= 3.0, < 5.0)
6
6
  activerecord (>= 3.0, < 5.0)
7
7
  railties (>= 3.0, < 5.0)
@@ -124,3 +124,6 @@ DEPENDENCIES
124
124
  rspec-rails
125
125
  sqlite3
126
126
  test-unit
127
+
128
+ BUNDLED WITH
129
+ 1.10.6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- lol_dba (2.0.0)
4
+ lol_dba (2.0.1)
5
5
  actionpack (>= 3.0, < 5.0)
6
6
  activerecord (>= 3.0, < 5.0)
7
7
  railties (>= 3.0, < 5.0)
@@ -112,3 +112,6 @@ DEPENDENCIES
112
112
  rspec-rails
113
113
  sqlite3
114
114
  test-unit
115
+
116
+ BUNDLED WITH
117
+ 1.10.6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- lol_dba (2.0.0)
4
+ lol_dba (2.0.1)
5
5
  actionpack (>= 3.0, < 5.0)
6
6
  activerecord (>= 3.0, < 5.0)
7
7
  railties (>= 3.0, < 5.0)
@@ -118,3 +118,6 @@ DEPENDENCIES
118
118
  rspec-rails
119
119
  sqlite3
120
120
  test-unit
121
+
122
+ BUNDLED WITH
123
+ 1.10.6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- lol_dba (2.0.0)
4
+ lol_dba (2.0.1)
5
5
  actionpack (>= 3.0, < 5.0)
6
6
  activerecord (>= 3.0, < 5.0)
7
7
  railties (>= 3.0, < 5.0)
@@ -143,3 +143,6 @@ DEPENDENCIES
143
143
  rspec-rails
144
144
  sqlite3
145
145
  test-unit
146
+
147
+ BUNDLED WITH
148
+ 1.10.6
data/lib/lol_dba.rb CHANGED
@@ -100,7 +100,7 @@ EOM
100
100
  poly_type = "#{reflection_options.name.to_s}_type"
101
101
  poly_id = "#{reflection_options.name.to_s}_id"
102
102
 
103
- index_name = [[poly_type, poly_id].sort]
103
+ index_name = [poly_type, poly_id].sort
104
104
  else
105
105
  foreign_key = reflection_options.options[:foreign_key] ||= reflection_options.respond_to?(:primary_key_name) ? reflection_options.primary_key_name : reflection_options.foreign_key
106
106
  index_name = foreign_key.to_s
@@ -1,3 +1,3 @@
1
1
  module LolDba
2
- VERSION = "2.0.1" unless defined? LolDba::VERSION
2
+ VERSION = "2.0.2" unless defined? LolDba::VERSION
3
3
  end
@@ -19,6 +19,10 @@ describe "Collect indexes based on associations:" do
19
19
  expect(relationship_indexes["addresses"]).to include("country_id")
20
20
  end
21
21
 
22
+ it "find indexes for polymorphic belongs_to" do
23
+ expect(relationship_indexes["addresses"]).to include(["addressable_id", "addressable_type"])
24
+ end
25
+
22
26
  it "find indexes for belongs_to with custom foreign key" do
23
27
  expect(relationship_indexes["companies"]).to include("owner_id")
24
28
  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.1
4
+ version: 2.0.2
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-10-24 00:00:00.000000000 Z
15
+ date: 2016-01-09 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activerecord
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.4.8
171
+ rubygems_version: 2.5.1
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: A small package of rake tasks to track down missing database indexes and