activerecord-simple_index_name 0.2.0 → 0.3.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +7 -3
- data/CHANGELOG.md +14 -1
- data/activerecord-simple_index_name.gemspec +1 -1
- data/gemfiles/rails_5_0.gemfile +5 -0
- data/lib/active_record/simple_index_name/active_record_ext.rb +10 -12
- data/lib/active_record/simple_index_name/version.rb +1 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 331455e2876faaeee9d150723bb84dfd0b9d8a44
|
4
|
+
data.tar.gz: d92216ba7ba686d5c932cdd43b57af444ef51ed4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93343a1cc0bc480e1fe49335b6b5a7f3683cf48aa184428107f3b6046e1e942072a92666bd6d08ab3d31c3b33023b1ae1d5610464d828085a7fcb1792d234385
|
7
|
+
data.tar.gz: 22899579a965de0905f6dd1b853cb13fdaed14ecc08ff438cbbd4d07e457748b9f837d2eba446f432bcf9bf04c8fb6fc5d5d9875d229d4097cdc5dcd3b2eba85
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
3
|
- 2.1
|
4
|
-
- 2.2
|
5
|
-
- 2.3
|
4
|
+
- 2.2.4
|
5
|
+
- 2.3.0
|
6
6
|
- ruby-head
|
7
7
|
gemfile:
|
8
8
|
- gemfiles/rails_4_0.gemfile
|
9
9
|
- gemfiles/rails_4_1.gemfile
|
10
10
|
- gemfiles/rails_4_2.gemfile
|
11
|
+
- gemfiles/rails_5_0.gemfile
|
11
12
|
cache: bundler
|
12
13
|
sudo: false
|
13
14
|
before_install: gem install bundler -v 1.10.6
|
@@ -26,4 +27,7 @@ notifications:
|
|
26
27
|
matrix:
|
27
28
|
allow_failures:
|
28
29
|
- rvm: ruby-head
|
29
|
-
|
30
|
+
exclude:
|
31
|
+
# NOTE: activesupport 5.x requires Ruby version >= 2.2.2
|
32
|
+
- rvm: 2.1
|
33
|
+
gemfile: gemfiles/rails_5_0.gemfile
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,20 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
3
|
## Unreleased
|
4
|
-
[full changelog](http://github.com/sue445/activerecord-simple_index_name/compare/v0.
|
4
|
+
[full changelog](http://github.com/sue445/activerecord-simple_index_name/compare/v0.3.0.beta1...master)
|
5
|
+
|
6
|
+
## v0.3.0.beta1
|
7
|
+
[full changelog](http://github.com/sue445/activerecord-simple_index_name/compare/v0.2.0...v0.3.0.beta1)
|
8
|
+
|
9
|
+
### Enhancements
|
10
|
+
* Support activerecord 5.0.0.beta2
|
11
|
+
* https://github.com/sue445/activerecord-simple_index_name/pull/22
|
12
|
+
|
13
|
+
### Other
|
14
|
+
* Keep ruby 2.3.x build on Travis CI
|
15
|
+
* https://github.com/sue445/activerecord-simple_index_name/pull/25
|
16
|
+
* Relax bundler version
|
17
|
+
* https://github.com/sue445/activerecord-simple_index_name/pull/26
|
5
18
|
|
6
19
|
## v0.2.0
|
7
20
|
[full changelog](http://github.com/sue445/activerecord-simple_index_name/compare/v0.1.0...v0.2.0)
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency "activerecord"
|
23
23
|
spec.add_dependency "activesupport"
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "bundler"
|
26
26
|
spec.add_development_dependency "coveralls"
|
27
27
|
spec.add_development_dependency "codeclimate-test-reporter"
|
28
28
|
spec.add_development_dependency "pry-byebug"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActiveRecord
|
2
|
-
module
|
3
|
-
module
|
4
|
-
def
|
2
|
+
module SimpleIndexName
|
3
|
+
module ActiveRecordExt
|
4
|
+
def index_name(table_name, options)
|
5
5
|
shorten_mode =
|
6
6
|
case Thread.current[:simple_index_name_shorten_mode]
|
7
7
|
when :enable
|
@@ -12,18 +12,16 @@ module ActiveRecord
|
|
12
12
|
ActiveRecord::SimpleIndexName.config.auto_shorten
|
13
13
|
end
|
14
14
|
|
15
|
-
if shorten_mode
|
16
|
-
|
17
|
-
Array.wrap(options[:column]) * "_and_"
|
18
|
-
else
|
19
|
-
index_name_without_simple(table_name, options)
|
20
|
-
end
|
15
|
+
if shorten_mode && Hash === options && options[:column]
|
16
|
+
Array.wrap(options[:column]) * "_and_"
|
21
17
|
else
|
22
|
-
|
18
|
+
super
|
23
19
|
end
|
24
20
|
end
|
25
|
-
|
26
|
-
alias_method_chain :index_name, :simple
|
27
21
|
end
|
28
22
|
end
|
29
23
|
end
|
24
|
+
|
25
|
+
ActiveRecord::ConnectionAdapters::AbstractAdapter.class_eval do
|
26
|
+
prepend ActiveRecord::SimpleIndexName::ActiveRecordExt
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-simple_index_name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: coveralls
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- gemfiles/rails_4_0.gemfile
|
187
187
|
- gemfiles/rails_4_1.gemfile
|
188
188
|
- gemfiles/rails_4_2.gemfile
|
189
|
+
- gemfiles/rails_5_0.gemfile
|
189
190
|
- lib/active_record/simple_index_name.rb
|
190
191
|
- lib/active_record/simple_index_name/active_record_ext.rb
|
191
192
|
- lib/active_record/simple_index_name/configuration.rb
|
@@ -210,12 +211,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
210
211
|
version: '0'
|
211
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
213
|
requirements:
|
213
|
-
- - "
|
214
|
+
- - ">"
|
214
215
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
216
|
+
version: 1.3.1
|
216
217
|
requirements: []
|
217
218
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.
|
219
|
+
rubygems_version: 2.5.1
|
219
220
|
signing_key:
|
220
221
|
specification_version: 4
|
221
222
|
summary: Shorten index name
|