schema_plus_pg_indexes 0.1.5 → 0.1.6

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: f8c943acae7e058adf7569dbe70a4fef42c76c4a
4
- data.tar.gz: 21b31c1c3e0488c6375989061814a2c4bdce65c0
3
+ metadata.gz: 809e25804e94035df8d24a57d5a255c8d64c8eb8
4
+ data.tar.gz: 92e7716fb86ece5c7f420b22ce6a75cfd36f3677
5
5
  SHA512:
6
- metadata.gz: ce0515363e77645cb4af33dd3cefdcdc76b692b8122254325b71a7e24ae136239fe0ca28a78b0d51bc65ba3c97425b1aae2cb6f3147ebac318228ed08b945a60
7
- data.tar.gz: 363c8fedeb17bc367802965a08eaa6c389caac8a10d2f58458a0c8b3935ff2c4199aa8fc734f95d3c25456b8c972f5792b01b64667b47af627348dba04759df6
6
+ metadata.gz: ef0acdf61aeda8a0c6980dba96ccbdb4357f7719476238742700cae71d83d757230b44bf19c353cc468a4ea1e479b1d4b1814e4b75911fcd3876b126af6b331f
7
+ data.tar.gz: 2bd3c3b3fb713678d041633c833c7c791e3a9d6909c2b714ce9197105471c38da4dbfcd00c38c90a9c014848a6f21dda7c61d92a05906bf12e16554fa9e9874b
data/README.md CHANGED
@@ -61,7 +61,8 @@ schema_plus_pg_indexes is tested on
61
61
 
62
62
  ## History
63
63
 
64
- * v0.1.5 - Bug fix: t.index without column in change_table
64
+ * v0.1.6 - Bug fix: operator class & multiple columns (#4). Thanks to [@nbudin](https://github.com/nbudin)
65
+ * v0.1.5 - Bug fix: `t.index` without column in `change_table`
65
66
  * v0.1.1 through v0.1.4 - Conform to schema_dev updates
66
67
  * v0.1.0 - Initial release
67
68
 
@@ -16,7 +16,7 @@ module SchemaPlusPgIndexes
16
16
  else
17
17
  index_dump.add_option "case_sensitive: false" unless index_def.case_sensitive?
18
18
  unless index_def.operator_classes.blank?
19
- if index_def.operator_classes.values.uniq.length == 1
19
+ if index_def.columns.uniq.length == 1 && index_def.operator_classes.values.uniq.length == 1
20
20
  index_dump.add_option "operator_class: #{index_def.operator_classes.values.first.inspect}"
21
21
  else
22
22
  index_dump.add_option "operator_class: {" + index_def.operator_classes.map{|column, val| "#{column.inspect}=>#{val.inspect}"}.join(", ") + "}"
@@ -1,3 +1,3 @@
1
1
  module SchemaPlusPgIndexes
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -97,6 +97,12 @@ describe "Schema dump" do
97
97
  expect(dump_posts).to match(/body.*index:.*operator_class: {"body"=>"text_pattern_ops", "string_no_default"=>"varchar_pattern_ops"}/)
98
98
  end
99
99
  end
100
+
101
+ it "should define multi-column operator classes even if one column has no operator" do
102
+ with_index Post, [:body, :string_no_default], :operator_class => {string_no_default: 'varchar_pattern_ops'} do
103
+ expect(dump_posts).to match(/body.*index:.*operator_class: {"string_no_default"=>"varchar_pattern_ops"}/)
104
+ end
105
+ end
100
106
 
101
107
  it 'should dump proper operator_class with case_sensitive => false' do
102
108
  with_index Post, :body, :operator_class => 'text_pattern_ops', :case_sensitive => false do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_plus_pg_indexes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-22 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord