schema_plus_pg_indexes 0.1.0 → 0.1.1

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: 1c7a0890c1692f1bccb36a22dd4c68c81385e2fa
4
- data.tar.gz: 6aefdddf74cca2fd8f72120b2098b674a69ae97d
3
+ metadata.gz: ab9e97841907e541e956b5913588e9da67ac61a3
4
+ data.tar.gz: 24f847eed723f93c188de98e38bdf32380a1b681
5
5
  SHA512:
6
- metadata.gz: b4418c479638217697120b8278121e7342da4eb4595c2af12807631f9ea5c60bed98645aeb02fe83973865a707159c10d2c3dbf38702642eeb06bab5eb4968bf
7
- data.tar.gz: fb4644fab3314297ad7ed94487006156630009d395cde790057a00c3818f942193a638de7dd4d53caf0cb77705d6d60367bb4a5b69f7a3aa9b73b583be6ab4ee
6
+ metadata.gz: 7b37d277f416c7bbbcafe1228cf0e96d8d7cc11f10d3e880076c587eef9a2d0d9e159091ed7d69f372bea5cc752d86e01796ea7019eabbc67c16ea27413c0f42
7
+ data.tar.gz: c162ca9beb5865f541193730ba48d1bb28566c8a874cbc45fe851b60ee4521d6e3f7c1488e9f7b0a6898669b8fc1fa88cb8ad04d223d4fd46ed13d97a77a5448
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  /coverage
2
2
  /tmp
3
3
  /pkg
4
+ /Gemfile.local
4
5
 
5
6
  *.lock
6
7
  *.log
data/README.md CHANGED
@@ -31,12 +31,12 @@ gem "schema_plus_pg_indexes"
31
31
 
32
32
  schema_plus_pg_indexes is tested on
33
33
 
34
- [//]: # SCHEMA_DEV: MATRIX - begin
35
- [//]: # These lines are auto-generated by schema_dev based on schema_dev.yml
34
+ <!-- SCHEMA_DEV: MATRIX - begin -->
35
+ <!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
36
36
  * ruby **1.9.3** with rails **4.2**, using **postgresql**
37
37
  * ruby **2.1.5** with rails **4.2**, using **postgresql**
38
38
 
39
- [//]: # SCHEMA_DEV: MATRIX - end
39
+ <!-- SCHEMA_DEV: MATRIX - end -->
40
40
 
41
41
 
42
42
  ## History
@@ -2,7 +2,6 @@ require 'schema_monkey'
2
2
  require 'schema_plus_indexes'
3
3
 
4
4
  require_relative 'schema_plus_pg_indexes/active_record/connection_adapters/index_definition'
5
- require_relative 'schema_plus_pg_indexes/middleware/migration'
6
5
  require_relative 'schema_plus_pg_indexes/middleware/postgresql/dumper'
7
6
  require_relative 'schema_plus_pg_indexes/middleware/postgresql/migration'
8
7
  require_relative 'schema_plus_pg_indexes/middleware/postgresql/query'
@@ -23,8 +23,8 @@ module SchemaPlusPgIndexes
23
23
  end
24
24
 
25
25
  def kind
26
- ActiveSupport::Deprecation.warn "ActiveRecord IndexDefinition#kind is deprecated, used #using instead"
27
- using
26
+ ActiveSupport::Deprecation.warn "ActiveRecord IndexDefinition#kind is deprecated, used #using.to_s instead"
27
+ using.to_s
28
28
  end
29
29
 
30
30
  def initialize_with_schema_plus_pg_indexes(*args)
@@ -3,9 +3,22 @@ module SchemaPlusPgIndexes
3
3
  module Postgresql
4
4
  module Migration
5
5
  def self.insert
6
+ SchemaMonkey::Middleware::Migration::Index.prepend DeprecateArgs
6
7
  SchemaMonkey::Middleware::Migration::IndexComponentsSql.append DefineExtensions
7
8
  end
8
9
 
10
+ class DeprecateArgs < SchemaMonkey::Middleware::Base
11
+ def call(env)
12
+ {:conditions => :where, :kind => :using}.each do |deprecated, proper|
13
+ if env.options[deprecated]
14
+ ActiveSupport::Deprecation.warn "ActiveRecord index option #{deprecated.inspect} is deprecated, use #{proper.inspect} instead"
15
+ env.options[proper] = env.options.delete(deprecated)
16
+ end
17
+ end
18
+ continue env
19
+ end
20
+ end
21
+
9
22
  class DefineExtensions < SchemaMonkey::Middleware::Base
10
23
  # SchemaPlusPgIndexes provides the following extra options for PostgreSQL
11
24
  # indexes:
@@ -1,3 +1,3 @@
1
1
  module SchemaPlusPgIndexes
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 1.7"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0.0"
27
- spec.add_development_dependency "schema_dev", "~> 2.0"
27
+ spec.add_development_dependency "schema_dev", "~> 2.0", ">= 2.0.3"
28
28
  spec.add_development_dependency "simplecov"
29
29
  spec.add_development_dependency "simplecov-gem-profile"
30
30
  end
@@ -43,7 +43,7 @@ describe 'Deprecations' do
43
43
  index = User.indexes.first
44
44
  expect(ActiveSupport::Deprecation).to receive(:warn).with(/kind.*using/)
45
45
  expect(index.using).to eq using # sanity check
46
- expect(index.kind).to eq index.using
46
+ expect(index.kind).to eq using.to_s
47
47
  end
48
48
  end
49
49
 
@@ -116,14 +116,6 @@ describe "Schema dump" do
116
116
  expect(dump_posts).to match(/body.*index:.*using: :hash/)
117
117
  end
118
118
  end
119
-
120
- it "should not include index order for non-ordered index types" do
121
- with_index Post, :user_id, :using => :hash do
122
- expect(dump_posts).to match(/user_id.*index:.*using: :hash/)
123
- expect(dump_posts).not_to match(%r{order})
124
- end
125
- end
126
-
127
119
  end
128
120
 
129
121
  protected
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_plus_pg_indexes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
@@ -101,6 +101,9 @@ dependencies:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '2.0'
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 2.0.3
104
107
  type: :development
105
108
  prerelease: false
106
109
  version_requirements: !ruby/object:Gem::Requirement
@@ -108,6 +111,9 @@ dependencies:
108
111
  - - "~>"
109
112
  - !ruby/object:Gem::Version
110
113
  version: '2.0'
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 2.0.3
111
117
  - !ruby/object:Gem::Dependency
112
118
  name: simplecov
113
119
  requirement: !ruby/object:Gem::Requirement
@@ -154,7 +160,6 @@ files:
154
160
  - gemfiles/rails-4.2/Gemfile.postgresql
155
161
  - lib/schema_plus_pg_indexes.rb
156
162
  - lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb
157
- - lib/schema_plus_pg_indexes/middleware/migration.rb
158
163
  - lib/schema_plus_pg_indexes/middleware/postgresql/dumper.rb
159
164
  - lib/schema_plus_pg_indexes/middleware/postgresql/migration.rb
160
165
  - lib/schema_plus_pg_indexes/middleware/postgresql/query.rb
@@ -1,23 +0,0 @@
1
- module SchemaPlusPgIndexes
2
- module Middleware
3
- module Migration
4
-
5
- def self.insert
6
- SchemaMonkey::Middleware::Migration::Index.prepend DeprecateArgs
7
- end
8
-
9
- class DeprecateArgs < SchemaMonkey::Middleware::Base
10
- def call(env)
11
- {:conditions => :where, :kind => :using}.each do |deprecated, proper|
12
- if env.options[deprecated]
13
- ActiveSupport::Deprecation.warn "ActiveRecord index option #{deprecated.inspect} is deprecated, use #{proper.inspect} instead"
14
- env.options[proper] = env.options.delete(deprecated)
15
- end
16
- end
17
- continue env
18
- end
19
- end
20
-
21
- end
22
- end
23
- end