enum_fields 0.4.0 → 0.4.2
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +3 -3
- data/lib/enum_fields/enum_field.rb +2 -2
- data/lib/enum_fields/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f68efaa8f90e2513096afc1c1238d51c8c0abf85830e7801ad31ecfca125b03
|
|
4
|
+
data.tar.gz: 5aaf0ad149d985c0bc692da2eaa8d5bfdbadd5e1fe3cc64bd7836ced15f5f938
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6e3af5170942bab989dd920faed8a85740c9e26710bc3f55a7110ff509aa237e980cb892c69045586c60d391f7584ec636ca370d3d93003a84b5c988c7fac03
|
|
7
|
+
data.tar.gz: 303c15c3c46034e216874e1f8138f4f699727a8515819fbe9c398c5b2853b7e21045973919533cbe06fdc7fcd02fd8e0a9f35bb39b37992bf88060676b9985cb
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [X.X.X] - YYYY-MM-DD
|
|
9
9
|
|
|
10
|
+
## [0.4.2] - 2026-07-13
|
|
11
|
+
|
|
12
|
+
- Fix `*_options` to emit each definition's stored `value` instead of its key, so options generated from array definitions or hash definitions with keys that differ from their values submit values the inclusion validation actually accepts
|
|
13
|
+
- Bump `required_ruby_version` to `>= 3.1` to match the anonymous block forwarding syntax already used by the gem, which raised `SyntaxError` on Ruby 2.7/3.0 despite the gemspec claiming support
|
|
14
|
+
- Fix README to document the singular `*_values`/`*_options` class methods (e.g. `Campaign.stage_values`) that the gem actually defines, instead of the nonexistent pluralized forms (e.g. `Campaign.stages_values`)
|
|
15
|
+
|
|
16
|
+
## [0.4.1] - 2026-03-26
|
|
17
|
+
|
|
18
|
+
- Update `bin/ci` and `bin/release` to use new formatting functions
|
|
19
|
+
- Add `--quiet` flag to `bin/ci` to suppress output
|
|
20
|
+
- Add `--dry-run` flag to `bin/release` to perform a dry run of the release process
|
|
21
|
+
|
|
10
22
|
## [0.4.0] - 2026-03-08
|
|
11
23
|
|
|
12
24
|
- Extract out Configuration to define global configuration for all enum fields
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Enhanced enum-like fields for ActiveRecord models with metadata support
|
|
|
4
4
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
7
|
-
- Ruby >=
|
|
7
|
+
- Ruby >= 3.1
|
|
8
8
|
- Rails >= 6.0 (ActiveRecord and ActiveSupport)
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
@@ -181,10 +181,10 @@ Campaign.stages
|
|
|
181
181
|
Campaign.stages_count # 3
|
|
182
182
|
|
|
183
183
|
# Returns the values of the definitions
|
|
184
|
-
Campaign.
|
|
184
|
+
Campaign.stage_values # ["draft", "scheduled", "completed"]
|
|
185
185
|
|
|
186
186
|
# Returns the options for form helpers
|
|
187
|
-
Campaign.
|
|
187
|
+
Campaign.stage_options # [["Draft", "draft"], ["Scheduled", "scheduled"], ["Completed", "completed"]]
|
|
188
188
|
|
|
189
189
|
# Returns the value for a specific key
|
|
190
190
|
Campaign.draft_stage_value # "draft"
|
|
@@ -59,8 +59,8 @@ module EnumFields
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
@model_class.define_singleton_method("#{@accessor}_options") do
|
|
62
|
-
definition_data.map do |
|
|
63
|
-
[metadata[:label],
|
|
62
|
+
definition_data.map do |_key, metadata|
|
|
63
|
+
[metadata[:label], metadata[:value]]
|
|
64
64
|
end
|
|
65
65
|
end
|
|
66
66
|
end
|
data/lib/enum_fields/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: enum_fields
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kinnell Shah
|
|
@@ -89,14 +89,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
89
89
|
requirements:
|
|
90
90
|
- - ">="
|
|
91
91
|
- !ruby/object:Gem::Version
|
|
92
|
-
version:
|
|
92
|
+
version: '3.1'
|
|
93
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
requirements:
|
|
95
95
|
- - ">="
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
97
|
version: '2.0'
|
|
98
98
|
requirements: []
|
|
99
|
-
rubygems_version:
|
|
99
|
+
rubygems_version: 3.6.9
|
|
100
100
|
specification_version: 4
|
|
101
101
|
summary: Enhanced enum-like fields for ActiveRecord models with metadata support
|
|
102
102
|
test_files: []
|