schema_plus_columns 1.0.0 → 1.0.1.beta.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
  SHA256:
3
- metadata.gz: 3a6e58371d05870ceea295862d0f73b6642fde572aa74b14e5ca287f5bfcb4d7
4
- data.tar.gz: 24f99b1bcb7a03607629699ea4de22ba75328530d9358671e08ff2877b3c329e
3
+ metadata.gz: cd5e4efc67e4cab5a342c05aa2b3fc930885f0a0ce62b61c2cc419d38ac85fc0
4
+ data.tar.gz: e908a69df189fa5ed3c6b798273e8e5c1dab2558df72c1f720b5305015eca863
5
5
  SHA512:
6
- metadata.gz: a1f1feb7baf5035681ac94585ad7c0030e36dcd7cc5f114e491d650d647a2673566e5caaa81875aa429be97c9d83630560e6eeded4aa20d435f1c740079ec7c8
7
- data.tar.gz: e2869fb420e6a486ea0d144ab02d6b7e8691d5fec1f72b64f29832f7564bb9a49587e124b4cb6665236739819e9d5538c259c699f80a0433517c0255b4673253
6
+ metadata.gz: 604f45ab374463daa68db2213ab984254d99b7278b798f7e45c6186613843ad019a21be36b02583761a618d4b90aadb6b230cd805b22d716a4eb168409deacec
7
+ data.tar.gz: 83eec6f83bd335fa831cfd3ef7f5f770218068199604b99366f92b1eca96a20a5832f0ba4a0f2dc09ade4ad6d4a53117cada169ff0d6290591b7ccf2ce34d4f9
@@ -22,9 +22,12 @@ jobs:
22
22
  - '2.5'
23
23
  - '2.7'
24
24
  - '3.0'
25
+ - '3.1'
25
26
  activerecord:
26
27
  - '5.2'
27
28
  - '6.0'
29
+ - '6.1'
30
+ - '7.0'
28
31
  db:
29
32
  - mysql2
30
33
  - sqlite3
@@ -34,6 +37,10 @@ jobs:
34
37
  exclude:
35
38
  - ruby: '3.0'
36
39
  activerecord: '5.2'
40
+ - ruby: '3.1'
41
+ activerecord: '5.2'
42
+ - ruby: '2.5'
43
+ activerecord: '7.0'
37
44
  - db: skip
38
45
  dbversion: skip
39
46
  include:
@@ -45,6 +52,10 @@ jobs:
45
52
  activerecord: '6.0'
46
53
  db: postgresql
47
54
  dbversion: '9.6'
55
+ - ruby: '2.5'
56
+ activerecord: '6.1'
57
+ db: postgresql
58
+ dbversion: '9.6'
48
59
  - ruby: '2.7'
49
60
  activerecord: '5.2'
50
61
  db: postgresql
@@ -53,10 +64,38 @@ jobs:
53
64
  activerecord: '6.0'
54
65
  db: postgresql
55
66
  dbversion: '9.6'
67
+ - ruby: '2.7'
68
+ activerecord: '6.1'
69
+ db: postgresql
70
+ dbversion: '9.6'
71
+ - ruby: '2.7'
72
+ activerecord: '7.0'
73
+ db: postgresql
74
+ dbversion: '9.6'
75
+ - ruby: '3.0'
76
+ activerecord: '6.0'
77
+ db: postgresql
78
+ dbversion: '9.6'
79
+ - ruby: '3.0'
80
+ activerecord: '6.1'
81
+ db: postgresql
82
+ dbversion: '9.6'
56
83
  - ruby: '3.0'
84
+ activerecord: '7.0'
85
+ db: postgresql
86
+ dbversion: '9.6'
87
+ - ruby: '3.1'
57
88
  activerecord: '6.0'
58
89
  db: postgresql
59
90
  dbversion: '9.6'
91
+ - ruby: '3.1'
92
+ activerecord: '6.1'
93
+ db: postgresql
94
+ dbversion: '9.6'
95
+ - ruby: '3.1'
96
+ activerecord: '7.0'
97
+ db: postgresql
98
+ dbversion: '9.6'
60
99
  env:
61
100
  BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
62
101
  MYSQL_DB_HOST: 127.0.0.1
data/README.md CHANGED
@@ -58,9 +58,17 @@ SchemaPlus::Columns is tested on:
58
58
  <!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
59
59
  * ruby **2.5** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql:9.6**
60
60
  * ruby **2.5** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
61
+ * ruby **2.5** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
61
62
  * ruby **2.7** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql:9.6**
62
63
  * ruby **2.7** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
64
+ * ruby **2.7** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
65
+ * ruby **2.7** with activerecord **7.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
63
66
  * ruby **3.0** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
67
+ * ruby **3.0** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
68
+ * ruby **3.0** with activerecord **7.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
69
+ * ruby **3.1** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
70
+ * ruby **3.1** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
71
+ * ruby **3.1** with activerecord **7.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
64
72
 
65
73
  <!-- SCHEMA_DEV: MATRIX - end -->
66
74
 
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 6.1", "< 6.2"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 7.0", "< 7.1"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -8,6 +8,10 @@ module SchemaPlus::Columns
8
8
  # SchemaPlus::Index adds several methods to Column
9
9
  #
10
10
  module Column
11
+ # AR 6.1+ freezes the columns. Temporary hack until I figure a better way to set the model
12
+ def freeze
13
+ self
14
+ end
11
15
 
12
16
  attr_writer :model # model assigned set by Middleware::Model::Columns
13
17
 
@@ -15,7 +19,7 @@ module SchemaPlus::Columns
15
19
  # refers to this column. Returns an empty list if there are no
16
20
  # such indexes.
17
21
  def indexes
18
- @indexes ||= @model.indexes.select{|index| index.columns.include? self.name}
22
+ @model.indexes.select{|index| index.columns.include? self.name}
19
23
  end
20
24
 
21
25
  # If the column is in a unique index, returns a list of names of other columns in
@@ -64,4 +68,3 @@ module SchemaPlus::Columns
64
68
  end
65
69
  end
66
70
  end
67
-
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SchemaPlus
4
4
  module Columns
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1.beta.1'
6
6
  end
7
7
  end
data/schema_dev.yml CHANGED
@@ -2,9 +2,12 @@ ruby:
2
2
  - 2.5
3
3
  - 2.7
4
4
  - 3.0
5
+ - 3.1
5
6
  activerecord:
6
7
  - 5.2
7
8
  - 6.0
9
+ - 6.1
10
+ - 7.0
8
11
  db:
9
12
  - mysql2
10
13
  - sqlite3
@@ -20,12 +20,12 @@ Gem::Specification.new do |gem|
20
20
 
21
21
  gem.required_ruby_version = '>= 2.5'
22
22
 
23
- gem.add_dependency 'activerecord', '>= 5.2', '< 6.1'
24
- gem.add_dependency 'schema_plus_core', '~> 3.0'
25
- gem.add_dependency 'schema_plus_indexes', '~> 1.0.0'
23
+ gem.add_dependency 'activerecord', '>= 5.2', '< 7.1'
24
+ gem.add_dependency 'schema_plus_core', '~> 3.1.beta.1'
25
+ gem.add_dependency 'schema_plus_indexes', '~> 1.0.1.beta.1'
26
26
 
27
27
  gem.add_development_dependency 'bundler'
28
28
  gem.add_development_dependency 'rake', '~> 13.0'
29
29
  gem.add_development_dependency 'rspec', '~> 3.0'
30
- gem.add_development_dependency 'schema_dev', '~> 4.1'
30
+ gem.add_development_dependency 'schema_dev', '~> 4.2.beta.1'
31
31
  end
data/spec/column_spec.rb CHANGED
@@ -24,14 +24,10 @@ describe "Column" do
24
24
  when SchemaDev::Rspec::Helpers.sqlite3?
25
25
  { "sql_type" => "varchar" }
26
26
  end
27
- if Gem::Requirement.new('< 5.0.0.alpha.1').satisfied_by?(::ActiveRecord.version)
28
- expect(JSON.parse(@login.to_json)).to include(type.merge("name" => "login"))
29
- else
30
- expect(JSON.parse(@login.to_json)).to include(
31
- "name" => "login",
32
- "sql_type_metadata" => a_hash_including(type)
33
- )
34
- end
27
+ expect(JSON.parse(@login.to_json)).to include(
28
+ "name" => "login",
29
+ "sql_type_metadata" => a_hash_including(type)
30
+ )
35
31
  end
36
32
  end
37
33
 
@@ -101,7 +97,7 @@ describe "Column" do
101
97
  context "index", :mysql => :skip do
102
98
 
103
99
  it "reports column as case insensitive" do
104
- allow(User.indexes.first).to receive(:case_sensitive?).and_return(false);
100
+ allow(User.indexes.first).to receive(:case_sensitive?).and_return(false)
105
101
  expect(@column).not_to be_case_sensitive
106
102
  end
107
103
  end
@@ -109,10 +105,16 @@ describe "Column" do
109
105
  context "database", :mysql => :only do
110
106
 
111
107
  # make sure we haven't broken mysql's method
108
+ # mysql determines case insensitivity its own way
112
109
  it "reports column as case insensitive" do
113
- allow(migration).to receive(:collation).and_return("utf8_unicode_ci") # mysql determines case insensitivity its own way
110
+ allow(@column).to receive(:collation).and_return("utf8_unicode_ci")
114
111
  expect(@column).not_to be_case_sensitive
115
112
  end
113
+
114
+ it "reports column as case sensitive" do
115
+ allow(@column).to receive(:collation).and_return("utf8_unicode")
116
+ expect(@column).to be_case_sensitive
117
+ end
116
118
  end
117
119
  end
118
120
 
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'simplecov'
4
- SimpleCov.start
4
+ SimpleCov.start unless SimpleCov.running
5
5
 
6
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
7
7
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_plus_columns
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-05 00:00:00.000000000 Z
11
+ date: 2022-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.1'
22
+ version: '7.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,35 +29,35 @@ dependencies:
29
29
  version: '5.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.1'
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: schema_plus_core
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '3.0'
39
+ version: 3.1.beta.1
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '3.0'
46
+ version: 3.1.beta.1
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: schema_plus_indexes
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 1.0.0
53
+ version: 1.0.1.beta.1
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 1.0.0
60
+ version: 1.0.1.beta.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: bundler
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '4.1'
109
+ version: 4.2.beta.1
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '4.1'
116
+ version: 4.2.beta.1
117
117
  description:
118
118
  email:
119
119
  - ronen@barzel.org
@@ -137,6 +137,14 @@ files:
137
137
  - gemfiles/activerecord-6.0/Gemfile.mysql2
138
138
  - gemfiles/activerecord-6.0/Gemfile.postgresql
139
139
  - gemfiles/activerecord-6.0/Gemfile.sqlite3
140
+ - gemfiles/activerecord-6.1/Gemfile.base
141
+ - gemfiles/activerecord-6.1/Gemfile.mysql2
142
+ - gemfiles/activerecord-6.1/Gemfile.postgresql
143
+ - gemfiles/activerecord-6.1/Gemfile.sqlite3
144
+ - gemfiles/activerecord-7.0/Gemfile.base
145
+ - gemfiles/activerecord-7.0/Gemfile.mysql2
146
+ - gemfiles/activerecord-7.0/Gemfile.postgresql
147
+ - gemfiles/activerecord-7.0/Gemfile.sqlite3
140
148
  - lib/schema_plus/columns.rb
141
149
  - lib/schema_plus/columns/active_record/connection_adapters/column.rb
142
150
  - lib/schema_plus/columns/middleware/model.rb
@@ -162,9 +170,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
162
170
  version: '2.5'
163
171
  required_rubygems_version: !ruby/object:Gem::Requirement
164
172
  requirements:
165
- - - ">="
173
+ - - ">"
166
174
  - !ruby/object:Gem::Version
167
- version: '0'
175
+ version: 1.3.1
168
176
  requirements: []
169
177
  rubygems_version: 3.2.33
170
178
  signing_key: