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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ea818b092133716848f5afefa6adbd282f6377a4ce2f02687b0e1fa25a2e9c6
4
- data.tar.gz: 234893cb582d30e6fa5f048dac118c5298ccc7f6ab96b5c45f7a9ef2defd0cc9
3
+ metadata.gz: 62d9fb8d7c77094ca6cef3a9deb43dc30cba70f8291ccf5dee451a04f441b6f6
4
+ data.tar.gz: b0066239ed831c85968aab4b0f9455137a8f37c7b2f9d856ec4fb76d8e54a341
5
5
  SHA512:
6
- metadata.gz: 28e54d2161217778d9cbd9876fe2689a56c46443070f1dbdeff33c1271bfcd19d63e38469b650aa95e466a86b5ceb2d19a75c1f1270a3d32512dd809d89a4840
7
- data.tar.gz: 6f14bd7f4ffface250b451eeec8d865b0f36271ae168a89755f7fd090be017bd4c6297f63401acfe844aaea6dda924358683e9512fc536770fdeb9b4dc121099
6
+ metadata.gz: 843ad7f5d576a913ffd9dae9d4c8eb63f9721d74cf9bd36b6fa323934a84a8a392637bf8f85437de23c7b205c5eadb97c9651eecfbe82a89654acc0f5b131e41
7
+ data.tar.gz: e3c5d24e76b67e97ffc37ed9a14c6fbb187d3ac99db443a73a7c1c7eb6ebb5ebc6d213795ffec796c026a6cc2ad665223c0e8b3babcec597c8296811284ea89a
@@ -8,7 +8,7 @@ on:
8
8
 
9
9
  jobs:
10
10
  test_sqlite:
11
- runs-on: ubuntu-20.04
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-20.04
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-20.04
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.6.1)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.6.1)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
data/Gemfile.7.1.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.6.1)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.6.1)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.6.1)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
@@ -70,4 +70,4 @@ DEPENDENCIES
70
70
  rspec (~> 3.4)
71
71
 
72
72
  BUNDLED WITH
73
- 2.6.1
73
+ 2.6.2
data/Gemfile.7.2.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.6.1)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.6.1)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.6.1)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
@@ -81,4 +81,4 @@ DEPENDENCIES
81
81
  sqlite3
82
82
 
83
83
  BUNDLED WITH
84
- 2.6.1
84
+ 2.6.2
@@ -1,3 +1,3 @@
1
1
  module ActiveType
2
- VERSION = '2.6.1'
2
+ VERSION = '2.6.3'
3
3
  end
@@ -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.1
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-01-17 00:00:00.000000000 Z
12
+ date: 2025-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler