activerecord-mysql-enum 0.1.1.pre.1 → 0.1.4

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
- SHA256:
3
- metadata.gz: e9a9f684ad661eef7023bb8d1d6803cab89a8b7eb4603e70295bcd75ba734404
4
- data.tar.gz: a01073f1a5eb099d42a7943b277e1cd1baa3359dfa6ceaef22b06227c49445c9
2
+ SHA1:
3
+ metadata.gz: 578ac3f22e8b3c8918ba90a0275b6cec90bc5b65
4
+ data.tar.gz: ee0b982c920256d50afeae9b9a2b8b4ec143e10f
5
5
  SHA512:
6
- metadata.gz: 6fa3141b422af92b266f4e64d5c94e3112a01bf29e0492a7b56c59a419d25bff390d87b48345f99a3782863b1d997b7711a66fef037c3d3133721d7d1c14ef30
7
- data.tar.gz: 1f1e4fa5c18209120d457f474cf2730df8345aa2f2361d2875221daa0685a26ccb7b314cd98c28d3420d1d779d6d281ea61ae026891c92598ae1f25fbfbb025e
6
+ metadata.gz: fe548ee120207058a9e1af2a87bcd95a120be896aa02b0e826ed856de893121d7604b106125d7f093695a0efd704959a3651eacd8940ea33779d474df3eada0f
7
+ data.tar.gz: 0e240650af84b1e562789fad514c9f1a01d11dedc3c39d67734632b51d0301a0e87b4d99c4814690c7cef107742d9b7f32c404cd9a622284d181a24c76948c02
@@ -4,9 +4,22 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [0.1.1.pre.1] - 2020-08-18
7
+ ## [0.1.4] - 2020-08-20
8
+ ### Fixed
9
+ - Fixed bug in `mysql_adapter` where optional arguments being passed to `type_to_sql` would cause
10
+ an unexpected error
11
+
12
+ ## [0.1.3] - 2020-08-19
13
+ ### Changed
14
+ - refactor mysql adapter
15
+
16
+ ## [0.1.2] - 2020-08-18
17
+ ### Changed
18
+ - fixed frozen string to reassign value instead of append
19
+
20
+ ## [0.1.1] - 2020-08-18
8
21
  ### Added
9
- - added rails 6 in dependency range
22
+ - extended activerecord dependency to '>= 4.2', '< 7'
10
23
 
11
24
  ## [0.1.0] - 2020-08-17
12
25
  ### Added
@@ -15,4 +28,8 @@ Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0
15
28
  ### Changed
16
29
  - Renamed the gem from `enum_column3` to `activerecord-mysql-enum`
17
30
 
18
- [0.1.0]: https://github.com/Invoca/activerecord-mysql-enum/tree/0.1.0
31
+ [0.1.4]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.3...v0.1.4
32
+ [0.1.3]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.2...v0.1.3
33
+ [0.1.2]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.1...v0.1.2
34
+ [0.1.1]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.0...v0.1.1
35
+ [0.1.0]: https://github.com/Invoca/activerecord-mysql-enum/tree/v0.1.0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-mysql-enum (0.1.1.pre.1)
4
+ activerecord-mysql-enum (0.1.4)
5
5
  activerecord (>= 4.2, < 7)
6
6
 
7
7
  GEM
@@ -28,29 +28,37 @@ module ActiveRecord
28
28
  #
29
29
  # will generate enum('a', 'b', 'c') for :limit => [:a, :b, :c]
30
30
  if Rails::VERSION::MAJOR < 5
31
- def type_to_sql(type, limit = nil, precision = nil, scale = nil, unsigned = nil, **_options) # :nodoc:
31
+ def type_to_sql(type, limit = nil, *args)
32
32
  if type.to_s == 'enum'
33
- native = native_database_types[type]
34
- column_type_sql = (native || {})[:name] || 'enum'
33
+ column_type_sql =
34
+ if (native_database_type = native_database_types[type])
35
+ native_database_type[:name]
36
+ else
37
+ 'enum'
38
+ end
35
39
 
36
- column_type_sql << "(#{limit.map { |v| quote(v) }.join(',')})"
40
+ quoted_values = limit.map { |v| quote(v) }.join(',')
37
41
 
38
- column_type_sql
42
+ "#{column_type_sql}(#{quoted_values})"
39
43
  else
40
- super(type, limit, precision, scale, unsigned)
44
+ super
41
45
  end
42
46
  end
43
47
  else
44
- def type_to_sql(type, limit: nil, precision: nil, scale: nil, unsigned: nil, **_options) # :nodoc:
48
+ def type_to_sql(type, limit: nil, **_options) # :nodoc:
45
49
  if type.to_s == 'enum'
46
- native = native_database_types[type]
47
- column_type_sql = (native || {})[:name] || 'enum'
50
+ column_type_sql =
51
+ if (native_database_type = native_database_types[type])
52
+ native_database_type[:name]
53
+ else
54
+ 'enum'
55
+ end
48
56
 
49
- column_type_sql << "(#{limit.map { |v| quote(v) }.join(',')})"
57
+ quoted_values = limit.map { |v| quote(v) }.join(',')
50
58
 
51
- column_type_sql
59
+ "#{column_type_sql}(#{quoted_values})"
52
60
  else
53
- super(type, limit: limit, precision: precision, scale: scale, unsigned: unsigned)
61
+ super
54
62
  end
55
63
  end
56
64
  end
@@ -3,7 +3,7 @@
3
3
  module ActiveRecord
4
4
  module Mysql
5
5
  module Enum
6
- VERSION = "0.1.1.pre.1"
6
+ VERSION = "0.1.4"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-mysql-enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.pre.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pohodnya
8
8
  - Invoca Development
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-08-18 00:00:00.000000000 Z
12
+ date: 2020-08-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -65,7 +65,7 @@ licenses: []
65
65
  metadata:
66
66
  source_code_uri: https://github.com/Invoca/activerecord-mysql-enum
67
67
  allowed_push_host: https://rubygems.org
68
- post_install_message:
68
+ post_install_message:
69
69
  rdoc_options: []
70
70
  require_paths:
71
71
  - lib
@@ -76,12 +76,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">"
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: 1.3.1
81
+ version: '0'
82
82
  requirements: []
83
- rubygems_version: 3.0.1
84
- signing_key:
83
+ rubyforge_project:
84
+ rubygems_version: 2.6.13
85
+ signing_key:
85
86
  specification_version: 4
86
87
  summary: Enable enum type for the MySQL Adapter in ActiveRecord
87
88
  test_files: []