enumerations 3.0.0 → 3.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1754e7d5747cf0444bf6b19ba7915f8517eecc6d847dc76af169442bb8d31aed
4
- data.tar.gz: e00f367b9c16a09155ee517163a6803afbed756d6ae24ea2bf945c5b062cbc01
3
+ metadata.gz: ffd7e847bde41b30265eb5ee97457a8013c860e8a3cb1ed138c34be818144824
4
+ data.tar.gz: 3260b6e35b460d9711d2156d1e81f10b616e991199c620de5e893439b075fd3a
5
5
  SHA512:
6
- metadata.gz: c43fe2bc75f47f1bd53c17f676a2648a2be94ea1598d42af96df85cb31add41db2cf0faf9a8b2bca47a3bb9fda2849f52be4076386fddbcacafe395e410a9cc2
7
- data.tar.gz: 9a858dcb732e394343c0f323fcf41433a9caf695d9d6d300f813cdb98f4d5bb4574c9c60eb46fe9be8005f374c7eed67f2a7604a655aa046f83c4bb701a083cf
6
+ metadata.gz: 9aeba453e25168363549b06c64269d86e6f6138b7876cc804a4ea3fb9c1eb350ed1dc21f6b17bc32021381f578ef7a9e69504e6925eb42e6fb84824aa8486f64
7
+ data.tar.gz: c264707570beef3b19677e8a8934baa5bfce5a4b8de9aa0121314729b08f2f10659520bf92d64668343f1f364be4a43c13da1ed8f1727cc24b74d80b6e109bef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [v3.0.1](https://github.com/infinum/enumerations/tree/v3.0.1) (2026-06-29)
4
+ [Full Changelog](https://github.com/infinum/enumerations/compare/v3.0.0...v3.0.1)
5
+
6
+ **Fixed bugs:**
7
+
8
+ - Return stored enumeration instances as-is from attribute getters [\#67](https://github.com/infinum/enumerations/pull/67)
9
+
3
10
  ## [v3.0.0](https://github.com/infinum/enumerations/tree/v3.0.0) (2026-01-16)
4
11
  [Full Changelog](https://github.com/infinum/enumerations/compare/v2.6.0...v3.0.0)
5
12
 
@@ -58,6 +58,7 @@ module Enumerations
58
58
 
59
59
  self.class.send :define_method, key do |locale: I18n.locale|
60
60
  case @attributes[key]
61
+ when Enumerations::Base then @attributes[key]
61
62
  when String, Symbol then translate_attribute(key, locale)
62
63
  else @attributes[key]
63
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Enumerations
4
- VERSION = '3.0.0'
4
+ VERSION = '3.0.1'
5
5
  end
data/test/value_test.rb CHANGED
@@ -108,4 +108,13 @@ class ValueTest < Minitest::Test
108
108
 
109
109
  assert_equal enum.foobar.upcase, 'FOOBAR'
110
110
  end
111
+
112
+ def test_enumeration_attribute_storing_another_enumeration_is_returned_as_is
113
+ enum = Class.new(Enumerations::Base) do
114
+ value :foobar, related: Role.admin
115
+ end
116
+
117
+ assert_instance_of Role, enum.foobar.related
118
+ assert_equal true, enum.foobar.related.admin?
119
+ end
111
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enumerations
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomislav Car
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 3.6.4
176
+ rubygems_version: 4.0.3
177
177
  specification_version: 4
178
178
  summary: Enumerations for ActiveRecord!
179
179
  test_files: