store_attribute 2.0.1 → 2.1.0
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 +7 -0
- data/README.md +3 -10
- data/lib/store_attribute/active_record/store.rb +3 -1
- data/lib/store_attribute/version.rb +1 -1
- metadata +9 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1846642dbb892be6b0a2428ee9687b90cff7edb89c0f16e5c583b6b841eee00
|
|
4
|
+
data.tar.gz: 4a7d7b77654182e2152e855b140d2d72c6e38c244974f6937cdd6ed3cf6d8d71
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8497c232c1f4d26dfa75df390fc0cb44b8c2ee5d375a7cb382a62e64fcb5ccc2d5cb08f632118fd84565af9d330b977df514b1073380aec9cca6e249bbadac62
|
|
7
|
+
data.tar.gz: b3f8793814b0cefaad1325faa8fe799c19e4261947bdd5d637ba3515dc0b6dbfbf144d02ef092675e8465eff3b4528869609fdc543819be377d4238200889ddd
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## master
|
|
4
4
|
|
|
5
|
+
## 2.1.0 (2026-01-12)
|
|
6
|
+
|
|
7
|
+
- **Require Ruby 3.2+ and Rails 7.2+.**
|
|
8
|
+
|
|
9
|
+
- Fix type lookup issue when registering store_attributes as attributes. ([@n-ivan][])
|
|
10
|
+
|
|
5
11
|
## 2.0.1 (2025-05-09) 🎇
|
|
6
12
|
|
|
7
13
|
- Register store_attributes as attributes. ([@rickcsong](https://github.com/rickcsong))
|
|
@@ -146,3 +152,4 @@ See [PR#22](https://github.com/palkan/store_attribute/pull/22).
|
|
|
146
152
|
[@glaszig]: https://github.com/glaszig
|
|
147
153
|
[@ioki-klaus]: https://github.com/ioki-klaus
|
|
148
154
|
[@markedmondson]: https://github.com/markedmondson
|
|
155
|
+
[@n-ivan]: https://github.com/n-ivan
|
data/README.md
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
## Store Attribute
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Active Record extension which adds type casting support to store accessors.
|
|
8
8
|
|
|
9
|
-
Originally extracted from
|
|
9
|
+
Originally extracted from the (unmerged) PR to Ruby on Rails: [rails/rails#18942](https://github.com/rails/rails/pull/18942).
|
|
10
10
|
|
|
11
11
|
### Install
|
|
12
12
|
|
|
13
13
|
In your Gemfile:
|
|
14
14
|
|
|
15
15
|
```ruby
|
|
16
|
-
# for Rails 6.1+
|
|
16
|
+
# for Rails 6.1+
|
|
17
17
|
gem "store_attribute", "~> 1.0"
|
|
18
18
|
|
|
19
19
|
# for Rails 5+ (6 is supported)
|
|
@@ -177,13 +177,6 @@ StoreAttribute.store_attribute_unset_values_fallback_to_default = false
|
|
|
177
177
|
|
|
178
178
|
Bug reports and pull requests are welcome on GitHub at [https://github.com/palkan/store_attribute](https://github.com/palkan/store_attribute).
|
|
179
179
|
|
|
180
|
-
For local development, you'll need PostgreSQL up and running. You can either install it on your host machine or run via Docker as follows:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
docker run --name store_attribute_postgres -e POSTGRES_HOST_AUTH_METHOD=trust -e POSTGRES_USER=$USER -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
|
|
184
|
-
docker exec -it store_attribute_postgres createdb -U $USER store_attribute_test
|
|
185
|
-
```
|
|
186
|
-
|
|
187
180
|
## License
|
|
188
181
|
|
|
189
182
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
@@ -139,8 +139,10 @@ module ActiveRecord
|
|
|
139
139
|
cast_type =
|
|
140
140
|
if type == :value
|
|
141
141
|
ActiveModel::Type::Value.new(**options.except(:default))
|
|
142
|
-
|
|
142
|
+
elsif type.is_a?(Symbol)
|
|
143
143
|
ActiveRecord::Type.lookup(type, **options.except(:default))
|
|
144
|
+
else
|
|
145
|
+
type
|
|
144
146
|
end
|
|
145
147
|
|
|
146
148
|
attribute(name, cast_type, **options)
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: store_attribute
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- palkan
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activerecord
|
|
@@ -16,28 +15,28 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
18
|
+
version: '7.2'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
25
|
+
version: '7.2'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
27
|
+
name: pglite
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
32
|
+
version: 0.0.5
|
|
34
33
|
type: :development
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
39
|
+
version: 0.0.5
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: rake
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -91,7 +90,6 @@ metadata:
|
|
|
91
90
|
documentation_uri: http://github.com/palkan/store_attribute
|
|
92
91
|
homepage_uri: http://github.com/palkan/store_attribute
|
|
93
92
|
source_code_uri: http://github.com/palkan/store_attribute
|
|
94
|
-
post_install_message:
|
|
95
93
|
rdoc_options: []
|
|
96
94
|
require_paths:
|
|
97
95
|
- lib
|
|
@@ -99,15 +97,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
99
97
|
requirements:
|
|
100
98
|
- - ">="
|
|
101
99
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: 3.
|
|
100
|
+
version: 3.2.0
|
|
103
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
102
|
requirements:
|
|
105
103
|
- - ">="
|
|
106
104
|
- !ruby/object:Gem::Version
|
|
107
105
|
version: '0'
|
|
108
106
|
requirements: []
|
|
109
|
-
rubygems_version: 3.
|
|
110
|
-
signing_key:
|
|
107
|
+
rubygems_version: 3.6.9
|
|
111
108
|
specification_version: 4
|
|
112
109
|
summary: ActiveRecord extension which adds typecasting to store accessors
|
|
113
110
|
test_files: []
|