sql_enum 0.1.16 → 0.2.2

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
- SHA1:
3
- metadata.gz: 176bd7182d8d1c489c2789a7885e5a0a51764d47
4
- data.tar.gz: cf001e95eecdf8eb28a31a1c6c48927be9934598
2
+ SHA256:
3
+ metadata.gz: dd16ecd7dbef436bf1613fa7b841e3575db7528778cee563fcb7128ae48ed24b
4
+ data.tar.gz: 474745a0a9090a1e9203493c6f4864a69fb07f622ece22e3db432142ef2de953
5
5
  SHA512:
6
- metadata.gz: 98f126d163128547f52d491bf84ab78b72c0573e8722dc315366534743b522576e3f34dbad3957154e3dc1e81de01d5b1e927ebbfe068cb7175b0bb627e572ce
7
- data.tar.gz: fb90f063ec354b3225cc0b7733bf39948fc4fab9af712cba2aa65abad13034c99c58b95f25034ac39ea9aafe83c5f20c84efdc342cef99173475f6098d470972
6
+ metadata.gz: 62b096819785f82af237b66cfe9cab150037e229796dda1e760f52e91140a8bcae092126e5bac5b0f51ea72cd25abad51ee9ad8f68b5ceb70b39682e18e367ce
7
+ data.tar.gz: 2c702f4de99f2c50513ae2b1cbcf17a349601d63b7e59a09750488358bca93632219924f444270a33befee9a28153970e0d129e1d20f62d30dc94ac028359d46
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
1
+ source "https://gem-proxy.chime.com"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
data/Gemfile.lock CHANGED
@@ -1,30 +1,29 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sql_enum (0.1.4)
5
- activerecord (~> 5.0)
4
+ sql_enum (0.2.2)
5
+ activerecord (>= 5.0)
6
6
 
7
7
  GEM
8
- remote: https://rubygems.org/
8
+ remote: https://gem-proxy.chime.com/
9
9
  specs:
10
- activemodel (5.1.5)
11
- activesupport (= 5.1.5)
12
- activerecord (5.1.5)
13
- activemodel (= 5.1.5)
14
- activesupport (= 5.1.5)
15
- arel (~> 8.0)
16
- activesupport (5.1.5)
10
+ activemodel (6.1.3.2)
11
+ activesupport (= 6.1.3.2)
12
+ activerecord (6.1.3.2)
13
+ activemodel (= 6.1.3.2)
14
+ activesupport (= 6.1.3.2)
15
+ activesupport (6.1.3.2)
17
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (~> 0.7)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- arel (8.0.0)
22
- concurrent-ruby (1.0.5)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ zeitwerk (~> 2.3)
21
+ concurrent-ruby (1.1.8)
23
22
  diff-lcs (1.3)
24
- i18n (0.9.5)
23
+ i18n (1.8.10)
25
24
  concurrent-ruby (~> 1.0)
26
- minitest (5.11.3)
27
- rake (10.5.0)
25
+ minitest (5.14.4)
26
+ rake (13.0.3)
28
27
  rspec (3.7.0)
29
28
  rspec-core (~> 3.7.0)
30
29
  rspec-expectations (~> 3.7.0)
@@ -38,18 +37,18 @@ GEM
38
37
  diff-lcs (>= 1.2.0, < 2.0)
39
38
  rspec-support (~> 3.7.0)
40
39
  rspec-support (3.7.1)
41
- thread_safe (0.3.6)
42
- tzinfo (1.2.5)
43
- thread_safe (~> 0.1)
40
+ tzinfo (2.0.4)
41
+ concurrent-ruby (~> 1.0)
42
+ zeitwerk (2.4.2)
44
43
 
45
44
  PLATFORMS
46
45
  ruby
47
46
 
48
47
  DEPENDENCIES
49
48
  bundler (~> 1.16)
50
- rake (~> 10.0)
49
+ rake (~> 13.0)
51
50
  rspec (~> 3.0)
52
51
  sql_enum!
53
52
 
54
53
  BUNDLED WITH
55
- 1.16.1
54
+ 1.17.3
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
2
  module ConnectionAdapters
3
3
  class AbstractMysqlAdapter
4
- def initialize_type_map_with_enum(m)
4
+ def initialize_type_map_with_enum(m = type_map)
5
5
  initialize_without_enum(m)
6
6
  register_enum_type(m)
7
7
  end
@@ -20,8 +20,15 @@ module ActiveRecord
20
20
  detect_enum_conflict!(name, "#{name}=")
21
21
 
22
22
  attr = attribute_alias?(name) ? attribute_alias(name) : name
23
- decorate_attribute_type(attr, :enum) do |subtype|
24
- EnumType.new(attr, enum_values, subtype)
23
+
24
+ if Rails.version >= '6.1'
25
+ decorate_attribute_type(name) do |subtype|
26
+ EnumType.new(attr, enum_values, subtype)
27
+ end
28
+ else
29
+ decorate_attribute_type(attr, :enum) do |subtype|
30
+ EnumType.new(attr, enum_values, subtype)
31
+ end
25
32
  end
26
33
 
27
34
  enum_values = values(name)
@@ -41,7 +48,7 @@ module ActiveRecord
41
48
 
42
49
  # def active?() status == 0 end
43
50
  klass.send(:detect_enum_conflict!, name, "#{value_method_name}?")
44
- define_method("#{value_method_name}?") { self[attr] == value.to_s }
51
+ define_method("#{value_method_name}?") { self[attr] == value.to_sym }
45
52
 
46
53
  # def active!() update! status: :active end
47
54
  klass.send(:detect_enum_conflict!, name, "#{value_method_name}!")
@@ -1,3 +1,3 @@
1
1
  module SqlEnum
2
- VERSION = "0.1.16"
2
+ VERSION = "0.2.2"
3
3
  end
data/sql_enum.gemspec CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_dependency "activerecord"
23
+ spec.add_dependency "activerecord", ">= 5.0"
24
24
  spec.add_development_dependency "bundler", "~> 1.16"
25
- spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rake", "~> 13.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Fowler
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-14 00:00:00.000000000 Z
11
+ date: 2021-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.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: '10.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
- description:
69
+ description:
70
70
  email:
71
71
  - fletch@fzf.me
72
72
  executables: []
@@ -98,7 +98,7 @@ homepage: https://github.com/1debit/sql_enum
98
98
  licenses:
99
99
  - MIT
100
100
  metadata: {}
101
- post_install_message:
101
+ post_install_message:
102
102
  rdoc_options: []
103
103
  require_paths:
104
104
  - lib
@@ -113,9 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubyforge_project:
117
- rubygems_version: 2.5.2
118
- signing_key:
116
+ rubygems_version: 3.1.6
117
+ signing_key:
119
118
  specification_version: 4
120
119
  summary: Enable using native sql enums
121
120
  test_files: []