active_type 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/active_type/version.rb +1 -1
- data/lib/active_type/virtual_attributes.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b818373b67ad6b12646808562b48545c2c32ed846073660013132e619fc689c6
|
4
|
+
data.tar.gz: 204ebaf99158e1dd12f4255bf005cc123373ffaca797673427a8bb87981bbdae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26c254234076e2ad182baf8c279d1eaec7e78b388e44682da5323fa429313e0bb3ecb001d175eb2bdc0ae081962f1576f07f73900f7cefe67d5f0f423407ab22
|
7
|
+
data.tar.gz: b114398d46139b9ed15228392b231fd8198b734e6d7f821b09752bc84442f3dd52508dbdf4f7ca1411c971ab02dfc0ed1ee470755d3108cf7b1137f22e184a51
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
## Unreleased changes
|
6
6
|
|
7
|
+
## 2.3.0 (2022-07-21)
|
8
|
+
|
9
|
+
* Fixed: Fixed an issue when certain keywords are used as attribute names. Thanks to @tom-kuca.
|
10
|
+
* Fixed: Original Rails #attribute method now aliased as #ar_attribute correctly. Thanks to @sudoremo.
|
11
|
+
* Fixed: ActiveType::Object#serializable_hash includes virtual attributes.
|
12
|
+
|
7
13
|
## 2.2.0 (2022-06-02)
|
8
14
|
|
9
15
|
* Fixed: ActiveType now actually works for Rails 7. Sorry for that. Thanks to @atcruice.
|
data/lib/active_type/version.rb
CHANGED
@@ -100,7 +100,7 @@ module ActiveType
|
|
100
100
|
|
101
101
|
@module.module_eval <<-BODY, __FILE__, __LINE__ + 1
|
102
102
|
def #{name}_changed?
|
103
|
-
|
103
|
+
self.#{name} != virtual_attributes_were["#{name}"]
|
104
104
|
end
|
105
105
|
BODY
|
106
106
|
|
@@ -137,6 +137,7 @@ module ActiveType
|
|
137
137
|
class << self
|
138
138
|
if method_defined?(:attribute)
|
139
139
|
alias_method :ar_attribute, :attribute
|
140
|
+
alias_method :attribute, :at_attribute
|
140
141
|
end
|
141
142
|
end
|
142
143
|
end
|
@@ -217,6 +218,10 @@ module ActiveType
|
|
217
218
|
end
|
218
219
|
end
|
219
220
|
|
221
|
+
def attribute_names
|
222
|
+
super + self.class._virtual_column_names
|
223
|
+
end
|
224
|
+
|
220
225
|
def changed?
|
221
226
|
self.class._virtual_column_names.any? { |attr| virtual_attributes_were[attr] != send(attr) } || super
|
222
227
|
end
|
@@ -323,7 +328,7 @@ module ActiveType
|
|
323
328
|
end
|
324
329
|
end
|
325
330
|
|
326
|
-
def
|
331
|
+
def at_attribute(name, *args)
|
327
332
|
options = args.extract_options!
|
328
333
|
type = args.first
|
329
334
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-08-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|