enum_type 2.2.0 → 2.2.1
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 +5 -5
- data/.rspec +2 -1
- data/.ruby-version +1 -1
- data/Gemfile +2 -3
- data/Gemfile.lock +160 -84
- data/README.md +5 -0
- data/VERSION +1 -1
- data/enum_type.gemspec +12 -3
- data/spec/enum_type_spec.rb +12 -8
- data/spec/factories.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +12 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 89bc30e3e226b181141db43882f5fab69b0535a3440fe11e2abd2a2682a68fd5
|
|
4
|
+
data.tar.gz: e0ee22403862c1f77000691cd0e0a01f1c0757690f8154332f019d1632dfc442
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cc1b7a7596e279ce9d59f32e9eededb064bb756023a6a4331dd9dde97f2147c7362752ada6ef3bd8431cc875f3a6a0a9c3d0927128a838e0bc7950b1db9f0b3b
|
|
7
|
+
data.tar.gz: cf62c7272e2aa16ea21bb7f9c8d23b6280cbe0f463085161c9234fcdfbab0c630d4837543114a3022a76a407bc7acd58c06fefd287b0098f25c2cc6179717c37
|
data/.rspec
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
--color
|
|
2
|
+
--format documentation
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2.4.2
|
data/Gemfile
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
3
|
# DEPENDENCIES
|
|
4
|
-
gem '
|
|
5
|
-
gem 'activesupport', '>= 4.0', require: 'active_support/core_ext/object/try'
|
|
4
|
+
gem 'rails', '~> 4'
|
|
6
5
|
|
|
7
6
|
group :development do
|
|
8
7
|
# DEVELOPMENT
|
|
@@ -12,7 +11,7 @@ group :development do
|
|
|
12
11
|
|
|
13
12
|
# TEST
|
|
14
13
|
gem 'rspec'
|
|
15
|
-
gem '
|
|
14
|
+
gem 'factory_bot'
|
|
16
15
|
gem 'pg', platform: :mri
|
|
17
16
|
gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
|
|
18
17
|
end
|
data/Gemfile.lock
CHANGED
|
@@ -1,107 +1,183 @@
|
|
|
1
1
|
GEM
|
|
2
2
|
remote: https://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
actionmailer (4.2.10)
|
|
5
|
+
actionpack (= 4.2.10)
|
|
6
|
+
actionview (= 4.2.10)
|
|
7
|
+
activejob (= 4.2.10)
|
|
8
|
+
mail (~> 2.5, >= 2.5.4)
|
|
9
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
10
|
+
actionpack (4.2.10)
|
|
11
|
+
actionview (= 4.2.10)
|
|
12
|
+
activesupport (= 4.2.10)
|
|
13
|
+
rack (~> 1.6)
|
|
14
|
+
rack-test (~> 0.6.2)
|
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
17
|
+
actionview (4.2.10)
|
|
18
|
+
activesupport (= 4.2.10)
|
|
19
|
+
builder (~> 3.1)
|
|
20
|
+
erubis (~> 2.7.0)
|
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
|
23
|
+
activejob (4.2.10)
|
|
24
|
+
activesupport (= 4.2.10)
|
|
25
|
+
globalid (>= 0.3.0)
|
|
26
|
+
activemodel (4.2.10)
|
|
27
|
+
activesupport (= 4.2.10)
|
|
28
|
+
builder (~> 3.1)
|
|
29
|
+
activerecord (4.2.10)
|
|
30
|
+
activemodel (= 4.2.10)
|
|
31
|
+
activesupport (= 4.2.10)
|
|
32
|
+
arel (~> 6.0)
|
|
33
|
+
activerecord-jdbc-adapter (50.0)
|
|
14
34
|
activerecord (>= 2.2)
|
|
15
|
-
activerecord-jdbcpostgresql-adapter (
|
|
16
|
-
activerecord-jdbc-adapter (~>
|
|
17
|
-
jdbc-postgres (>= 9.
|
|
18
|
-
activesupport (4.
|
|
19
|
-
i18n (~> 0.
|
|
20
|
-
minitest (~>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
activerecord-jdbcpostgresql-adapter (50.0)
|
|
36
|
+
activerecord-jdbc-adapter (~> 50.0)
|
|
37
|
+
jdbc-postgres (>= 9.4, < 43)
|
|
38
|
+
activesupport (4.2.10)
|
|
39
|
+
i18n (~> 0.7)
|
|
40
|
+
minitest (~> 5.1)
|
|
41
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
|
42
|
+
tzinfo (~> 1.1)
|
|
43
|
+
addressable (2.4.0)
|
|
44
|
+
arel (6.0.4)
|
|
45
|
+
builder (3.2.3)
|
|
46
|
+
concurrent-ruby (1.0.5)
|
|
47
|
+
concurrent-ruby (1.0.5-java)
|
|
48
|
+
crass (1.0.3)
|
|
49
|
+
descendants_tracker (0.0.4)
|
|
50
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
|
51
|
+
diff-lcs (1.3)
|
|
52
|
+
erubis (2.7.0)
|
|
53
|
+
factory_bot (4.8.2)
|
|
31
54
|
activesupport (>= 3.0.0)
|
|
32
|
-
faraday (0.
|
|
33
|
-
multipart-post (
|
|
34
|
-
git (1.
|
|
35
|
-
github_api (0.
|
|
36
|
-
addressable
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
oauth2
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
faraday (0.9.2)
|
|
56
|
+
multipart-post (>= 1.2, < 3)
|
|
57
|
+
git (1.3.0)
|
|
58
|
+
github_api (0.16.0)
|
|
59
|
+
addressable (~> 2.4.0)
|
|
60
|
+
descendants_tracker (~> 0.0.4)
|
|
61
|
+
faraday (~> 0.8, < 0.10)
|
|
62
|
+
hashie (>= 3.4)
|
|
63
|
+
mime-types (>= 1.16, < 3.0)
|
|
64
|
+
oauth2 (~> 1.0)
|
|
65
|
+
globalid (0.4.1)
|
|
66
|
+
activesupport (>= 4.2.0)
|
|
67
|
+
hashie (3.5.6)
|
|
68
|
+
highline (1.7.10)
|
|
69
|
+
i18n (0.9.1)
|
|
70
|
+
concurrent-ruby (~> 1.0)
|
|
71
|
+
jar-dependencies (0.3.11)
|
|
72
|
+
jdbc-postgres (42.1.4)
|
|
73
|
+
jeweler (2.3.7)
|
|
48
74
|
builder
|
|
49
|
-
bundler (
|
|
75
|
+
bundler (>= 1)
|
|
50
76
|
git (>= 1.2.5)
|
|
51
|
-
github_api (
|
|
77
|
+
github_api (~> 0.16.0)
|
|
52
78
|
highline (>= 1.6.15)
|
|
53
|
-
nokogiri (
|
|
79
|
+
nokogiri (>= 1.5.10)
|
|
80
|
+
psych (~> 2.2)
|
|
54
81
|
rake
|
|
55
82
|
rdoc
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
83
|
+
semver2
|
|
84
|
+
jwt (1.5.6)
|
|
85
|
+
loofah (2.1.1)
|
|
86
|
+
crass (~> 1.0.2)
|
|
87
|
+
nokogiri (>= 1.5.9)
|
|
88
|
+
mail (2.7.0)
|
|
89
|
+
mini_mime (>= 0.1.1)
|
|
90
|
+
mime-types (2.99.3)
|
|
91
|
+
mini_mime (1.0.0)
|
|
92
|
+
mini_portile2 (2.3.0)
|
|
93
|
+
minitest (5.10.3)
|
|
94
|
+
multi_json (1.12.2)
|
|
95
|
+
multi_xml (0.6.0)
|
|
96
|
+
multipart-post (2.0.0)
|
|
97
|
+
nokogiri (1.8.1)
|
|
98
|
+
mini_portile2 (~> 2.3.0)
|
|
99
|
+
nokogiri (1.8.1-java)
|
|
100
|
+
oauth2 (1.4.0)
|
|
101
|
+
faraday (>= 0.8, < 0.13)
|
|
102
|
+
jwt (~> 1.0)
|
|
103
|
+
multi_json (~> 1.3)
|
|
71
104
|
multi_xml (~> 0.5)
|
|
72
|
-
rack (
|
|
73
|
-
pg (0.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
105
|
+
rack (>= 1.2, < 3)
|
|
106
|
+
pg (0.21.0)
|
|
107
|
+
psych (2.2.4)
|
|
108
|
+
psych (2.2.4-java)
|
|
109
|
+
jar-dependencies (>= 0.1.7)
|
|
110
|
+
rack (1.6.8)
|
|
111
|
+
rack-test (0.6.3)
|
|
112
|
+
rack (>= 1.0)
|
|
113
|
+
rails (4.2.10)
|
|
114
|
+
actionmailer (= 4.2.10)
|
|
115
|
+
actionpack (= 4.2.10)
|
|
116
|
+
actionview (= 4.2.10)
|
|
117
|
+
activejob (= 4.2.10)
|
|
118
|
+
activemodel (= 4.2.10)
|
|
119
|
+
activerecord (= 4.2.10)
|
|
120
|
+
activesupport (= 4.2.10)
|
|
121
|
+
bundler (>= 1.3.0, < 2.0)
|
|
122
|
+
railties (= 4.2.10)
|
|
123
|
+
sprockets-rails
|
|
124
|
+
rails-deprecated_sanitizer (1.0.3)
|
|
125
|
+
activesupport (>= 4.2.0.alpha)
|
|
126
|
+
rails-dom-testing (1.0.8)
|
|
127
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
|
128
|
+
nokogiri (~> 1.6)
|
|
129
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
|
130
|
+
rails-html-sanitizer (1.0.3)
|
|
131
|
+
loofah (~> 2.0)
|
|
132
|
+
railties (4.2.10)
|
|
133
|
+
actionpack (= 4.2.10)
|
|
134
|
+
activesupport (= 4.2.10)
|
|
135
|
+
rake (>= 0.8.7)
|
|
136
|
+
thor (>= 0.18.1, < 2.0)
|
|
137
|
+
rake (12.3.0)
|
|
138
|
+
rdoc (6.0.0)
|
|
139
|
+
redcarpet (3.4.0)
|
|
140
|
+
rspec (3.7.0)
|
|
141
|
+
rspec-core (~> 3.7.0)
|
|
142
|
+
rspec-expectations (~> 3.7.0)
|
|
143
|
+
rspec-mocks (~> 3.7.0)
|
|
144
|
+
rspec-core (3.7.0)
|
|
145
|
+
rspec-support (~> 3.7.0)
|
|
146
|
+
rspec-expectations (3.7.0)
|
|
147
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
148
|
+
rspec-support (~> 3.7.0)
|
|
149
|
+
rspec-mocks (3.7.0)
|
|
150
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
151
|
+
rspec-support (~> 3.7.0)
|
|
152
|
+
rspec-support (3.7.0)
|
|
153
|
+
semver2 (3.4.2)
|
|
154
|
+
sprockets (3.7.1)
|
|
155
|
+
concurrent-ruby (~> 1.0)
|
|
156
|
+
rack (> 1, < 3)
|
|
157
|
+
sprockets-rails (3.2.1)
|
|
158
|
+
actionpack (>= 4.0)
|
|
159
|
+
activesupport (>= 4.0)
|
|
160
|
+
sprockets (>= 3.0.0)
|
|
161
|
+
thor (0.20.0)
|
|
162
|
+
thread_safe (0.3.6)
|
|
163
|
+
thread_safe (0.3.6-java)
|
|
164
|
+
tzinfo (1.2.4)
|
|
165
|
+
thread_safe (~> 0.1)
|
|
166
|
+
yard (0.9.12)
|
|
93
167
|
|
|
94
168
|
PLATFORMS
|
|
95
169
|
java
|
|
96
170
|
ruby
|
|
97
171
|
|
|
98
172
|
DEPENDENCIES
|
|
99
|
-
activerecord (>= 4.0)
|
|
100
173
|
activerecord-jdbcpostgresql-adapter
|
|
101
|
-
|
|
102
|
-
factory_girl
|
|
174
|
+
factory_bot
|
|
103
175
|
jeweler
|
|
104
176
|
pg
|
|
177
|
+
rails (~> 4)
|
|
105
178
|
redcarpet
|
|
106
179
|
rspec
|
|
107
180
|
yard
|
|
181
|
+
|
|
182
|
+
BUNDLED WITH
|
|
183
|
+
1.16.0
|
data/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
> ⚠️ **DEPRECATED:** `enum_type` is no longer maintained. Modern Rails has
|
|
2
|
+
> native ActiveRecord enum support (`enum`) that covers most use cases; for
|
|
3
|
+
> PostgreSQL native ENUM types, consider alternatives like the
|
|
4
|
+
> `activerecord-postgres_enum` gem family. The final release is v2.2.1.
|
|
5
|
+
|
|
1
6
|
enum_type
|
|
2
7
|
=========
|
|
3
8
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.2.
|
|
1
|
+
2.2.1
|
data/enum_type.gemspec
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: enum_type 2.2.
|
|
5
|
+
# stub: enum_type 2.2.1 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "enum_type"
|
|
9
|
-
s.version = "2.2.
|
|
9
|
+
s.version = "2.2.1"
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
12
|
s.require_paths = ["lib"]
|
|
@@ -39,7 +39,16 @@ Gem::Specification.new do |s|
|
|
|
39
39
|
s.homepage = "http://github.com/riscfuture/enum_type"
|
|
40
40
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9")
|
|
41
41
|
s.rubygems_version = "2.2.0"
|
|
42
|
-
s.summary = "PostgreSQL enumerated types in ActiveRecord"
|
|
42
|
+
s.summary = "[DEPRECATED] PostgreSQL enumerated types in ActiveRecord"
|
|
43
|
+
s.post_install_message = <<~MSG
|
|
44
|
+
|
|
45
|
+
⚠️ DEPRECATED: enum_type is no longer maintained.
|
|
46
|
+
|
|
47
|
+
No longer maintained. Modern Rails has native ActiveRecord enum support (`enum`) that covers most use cases; for PostgreSQL native ENUM types, consider alternatives like the `activerecord-postgres_enum` gem family.
|
|
48
|
+
|
|
49
|
+
This is the final release. No further updates are planned.
|
|
50
|
+
|
|
51
|
+
MSG
|
|
43
52
|
|
|
44
53
|
if s.respond_to? :specification_version then
|
|
45
54
|
s.specification_version = 4
|
data/spec/enum_type_spec.rb
CHANGED
|
@@ -12,7 +12,9 @@ module SpecSupport
|
|
|
12
12
|
enum_type @field
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.field()
|
|
15
|
+
def self.field()
|
|
16
|
+
@field
|
|
17
|
+
end
|
|
16
18
|
|
|
17
19
|
def read_attribute(_)
|
|
18
20
|
instance_variable_get :"@#{self.class.field}"
|
|
@@ -67,7 +69,7 @@ describe EnumType do
|
|
|
67
69
|
|
|
68
70
|
context "[validations]" do
|
|
69
71
|
before :each do
|
|
70
|
-
@field =
|
|
72
|
+
@field = FactoryBot.generate(:enum_field)
|
|
71
73
|
SpecSupport::EnumTypeTester.set_field(@field)
|
|
72
74
|
@model = SpecSupport::EnumTypeTester.new
|
|
73
75
|
end
|
|
@@ -102,16 +104,18 @@ describe EnumType do
|
|
|
102
104
|
end
|
|
103
105
|
|
|
104
106
|
context '[:register_type option]' do
|
|
105
|
-
before(:each) { @field =
|
|
107
|
+
before(:each) { @field = FactoryBot.generate(:enum_field) }
|
|
106
108
|
|
|
107
109
|
it "should register each new PostgreSQL type with ActiveRecord when set" do
|
|
108
110
|
expect(Model.connection).
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
to receive(:select_one).once.
|
|
112
|
+
with(/SELECT atttypid FROM pg_catalog.pg_attribute WHERE attrelid = 'models'::regclass AND attname = '#{@field}'/).
|
|
113
|
+
and_return('atttypid' => '12345')
|
|
112
114
|
Model.enum_type @field, register_type: true
|
|
113
|
-
|
|
114
|
-
|
|
115
|
+
if ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID.const_defined?(:TYPE_MAP)
|
|
116
|
+
expect(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::TYPE_MAP[12345]).
|
|
117
|
+
to be_kind_of(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::Identity)
|
|
118
|
+
end
|
|
115
119
|
end
|
|
116
120
|
end
|
|
117
121
|
|
data/spec/factories.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: enum_type
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Morgan
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
10
|
date: 2013-12-26 00:00:00.000000000 Z
|
|
@@ -163,7 +162,14 @@ files:
|
|
|
163
162
|
homepage: http://github.com/riscfuture/enum_type
|
|
164
163
|
licenses: []
|
|
165
164
|
metadata: {}
|
|
166
|
-
post_install_message:
|
|
165
|
+
post_install_message: |2+
|
|
166
|
+
|
|
167
|
+
⚠️ DEPRECATED: enum_type is no longer maintained.
|
|
168
|
+
|
|
169
|
+
No longer maintained. Modern Rails has native ActiveRecord enum support (`enum`) that covers most use cases; for PostgreSQL native ENUM types, consider alternatives like the `activerecord-postgres_enum` gem family.
|
|
170
|
+
|
|
171
|
+
This is the final release. No further updates are planned.
|
|
172
|
+
|
|
167
173
|
rdoc_options: []
|
|
168
174
|
require_paths:
|
|
169
175
|
- lib
|
|
@@ -178,10 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
178
184
|
- !ruby/object:Gem::Version
|
|
179
185
|
version: '0'
|
|
180
186
|
requirements: []
|
|
181
|
-
|
|
182
|
-
rubygems_version: 2.2.0
|
|
183
|
-
signing_key:
|
|
187
|
+
rubygems_version: 4.0.11
|
|
184
188
|
specification_version: 4
|
|
185
|
-
summary: PostgreSQL enumerated types in ActiveRecord
|
|
189
|
+
summary: "[DEPRECATED] PostgreSQL enumerated types in ActiveRecord"
|
|
186
190
|
test_files: []
|
|
187
|
-
|
|
191
|
+
...
|