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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1377da78ce42ece7987b1f20f34021d2bdc7212c
4
- data.tar.gz: 83106f09ad6e965d9f8ae6532da1e34903a48fcf
3
+ metadata.gz: 331455e2876faaeee9d150723bb84dfd0b9d8a44
4
+ data.tar.gz: d92216ba7ba686d5c932cdd43b57af444ef51ed4
5
5
  SHA512:
6
- metadata.gz: c4477b4d253b2cec6fd0af1940e6ca50801ec4bf49023c012bf6db29646855251e46c23e9bd2dc7e0f0c0d81086345c2df0e938429ceb8a017dcda9e7d9222eb
7
- data.tar.gz: a5077e58cf3f0e2968d82892c9f77e3892a69ba5e0436503c270e89f4f2c84ae6048df01de740e4e15752fd15a113954e90d6ad98cb33a526de9a51600494afe
6
+ metadata.gz: 93343a1cc0bc480e1fe49335b6b5a7f3683cf48aa184428107f3b6046e1e942072a92666bd6d08ab3d31c3b33023b1ae1d5610464d828085a7fcb1792d234385
7
+ data.tar.gz: 22899579a965de0905f6dd1b853cb13fdaed14ecc08ff438cbbd4d07e457748b9f837d2eba446f432bcf9bf04c8fb6fc5d5d9875d229d4097cdc5dcd3b2eba85
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  log/
11
+ gemfiles/*.lock
12
+ gemfiles/vendor/bundle/
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
- - rvm: 2.3
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.2.0...master)
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", "~> 1.10"
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"
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.0.0.beta2"
4
+
5
+ gemspec path: '../'
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
- module ConnectionAdapters
3
- module SchemaStatements
4
- def index_name_with_simple(table_name, options)
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
- if Hash === options && options[:column]
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
- index_name_without_simple(table_name, options)
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
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module SimpleIndexName
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0.beta1"
4
4
  end
5
5
  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.2.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: 2015-12-20 00:00:00.000000000 Z
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: '1.10'
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: '1.10'
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: '0'
216
+ version: 1.3.1
216
217
  requirements: []
217
218
  rubyforge_project:
218
- rubygems_version: 2.4.5.1
219
+ rubygems_version: 2.5.1
219
220
  signing_key:
220
221
  specification_version: 4
221
222
  summary: Shorten index name