active_type 2.6.1 → 2.6.3
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/.github/workflows/test.yml +3 -3
- data/CHANGELOG.md +10 -0
- data/Gemfile.6.1.pg.lock +1 -1
- data/Gemfile.6.1.sqlite3.lock +1 -1
- data/Gemfile.7.1.pg.lock +1 -1
- data/Gemfile.7.1.sqlite3.lock +1 -1
- data/Gemfile.7.2.mysql2.lock +2 -2
- data/Gemfile.7.2.pg.lock +1 -1
- data/Gemfile.7.2.sqlite3.lock +1 -1
- data/Gemfile.8.0.sqlite3.lock +2 -2
- data/lib/active_type/version.rb +1 -1
- data/lib/active_type/virtual_attributes.rb +13 -0
- 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: 62d9fb8d7c77094ca6cef3a9deb43dc30cba70f8291ccf5dee451a04f441b6f6
|
4
|
+
data.tar.gz: b0066239ed831c85968aab4b0f9455137a8f37c7b2f9d856ec4fb76d8e54a341
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 843ad7f5d576a913ffd9dae9d4c8eb63f9721d74cf9bd36b6fa323934a84a8a392637bf8f85437de23c7b205c5eadb97c9651eecfbe82a89654acc0f5b131e41
|
7
|
+
data.tar.gz: e3c5d24e76b67e97ffc37ed9a14c6fbb187d3ac99db443a73a7c1c7eb6ebb5ebc6d213795ffec796c026a6cc2ad665223c0e8b3babcec597c8296811284ea89a
|
data/.github/workflows/test.yml
CHANGED
@@ -8,7 +8,7 @@ on:
|
|
8
8
|
|
9
9
|
jobs:
|
10
10
|
test_sqlite:
|
11
|
-
runs-on: ubuntu-
|
11
|
+
runs-on: ubuntu-24.04
|
12
12
|
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
@@ -38,7 +38,7 @@ jobs:
|
|
38
38
|
run: bundle exec rake spec
|
39
39
|
|
40
40
|
test_mysql:
|
41
|
-
runs-on: ubuntu-
|
41
|
+
runs-on: ubuntu-24.04
|
42
42
|
|
43
43
|
services:
|
44
44
|
mysql:
|
@@ -76,7 +76,7 @@ jobs:
|
|
76
76
|
run: bundle exec rake spec
|
77
77
|
|
78
78
|
test_pg:
|
79
|
-
runs-on: ubuntu-
|
79
|
+
runs-on: ubuntu-24.04
|
80
80
|
|
81
81
|
services:
|
82
82
|
postgres:
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## 2.6.3 (2025-08-11)
|
6
|
+
|
7
|
+
* Fixed: Autosave on associations will triggers saves when only virtual attributes have changed.
|
8
|
+
Thanks to @RohanM.
|
9
|
+
|
10
|
+
## 2.6.2 (2025-02-12)
|
11
|
+
|
12
|
+
* Fixed: Issue with `ActiveType::Object` when using an optional `belongs_to` on a virtual attribute.
|
13
|
+
Thanks to @kyanagi.
|
14
|
+
|
5
15
|
## 2.6.1 (2025-01-17)
|
6
16
|
|
7
17
|
* Fixed: Issue with `ActiveType::Object` when using has_many on Rails 7.2.
|
data/Gemfile.6.1.pg.lock
CHANGED
data/Gemfile.6.1.sqlite3.lock
CHANGED
data/Gemfile.7.1.pg.lock
CHANGED
data/Gemfile.7.1.sqlite3.lock
CHANGED
data/Gemfile.7.2.mysql2.lock
CHANGED
data/Gemfile.7.2.pg.lock
CHANGED
data/Gemfile.7.2.sqlite3.lock
CHANGED
data/Gemfile.8.0.sqlite3.lock
CHANGED
data/lib/active_type/version.rb
CHANGED
@@ -229,6 +229,10 @@ module ActiveType
|
|
229
229
|
self.class._virtual_column_names.any? { |attr| virtual_attributes_were[attr] != send(attr) } || super
|
230
230
|
end
|
231
231
|
|
232
|
+
def changed_for_autosave?
|
233
|
+
changed? || super
|
234
|
+
end
|
235
|
+
|
232
236
|
def changes
|
233
237
|
changes = self.class._virtual_column_names.each_with_object({}) do |attr, changes|
|
234
238
|
current_value = send(attr)
|
@@ -239,6 +243,15 @@ module ActiveType
|
|
239
243
|
super.merge(changes)
|
240
244
|
end
|
241
245
|
|
246
|
+
def attribute_changed?(attr, **)
|
247
|
+
attr = attr.to_s
|
248
|
+
if virtual_attributes.key?(attr)
|
249
|
+
virtual_attributes_were[attr] != send(attr)
|
250
|
+
else
|
251
|
+
super
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
242
255
|
if ActiveRecord::VERSION::MAJOR >= 4
|
243
256
|
def changes_applied
|
244
257
|
super
|
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.6.
|
4
|
+
version: 2.6.3
|
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: 2025-
|
12
|
+
date: 2025-08-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|