active_type 2.6.2 → 2.6.4

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: 8e6ed5e81a70acff0be214e9a3a653f4142fac9bd1a4a5840810d440da0c53c0
4
- data.tar.gz: f1634c346152775f229004f5a77b2c98c107f1a530219060fb7e1ca6d38f5b6c
3
+ metadata.gz: 7a0b2f6fb30a96dbcbbbce17bd19e3476ff6aa723506c511992a2635a6871d97
4
+ data.tar.gz: ea1191cda8575afdcb7b912d3f921f2d5b8f0fe3dc9f7ffca0547d86693d5d1e
5
5
  SHA512:
6
- metadata.gz: 71a7ba9a1d620cdd2ee58bfbcb1c3b087ebcaec36d4f4d984f434d959420df9da30eeb5b1eef035aebb9c76986a2578e4c9a6fba0fda3258bcce063faf2f5329
7
- data.tar.gz: 382be4ad591537dda5e19e58256c5479a1a12bd488d9939e697f3c68292746c2d8c23e518a0d7e3f9db48db4246007a7adaf1b778cdc29e92c58890715143cca
6
+ metadata.gz: 012e905251e98a6da960f5c1f04ca30d55d6af090812e31e5bb13dfa4832128d9cfd9128552a5e2118d23d97e09016070c094d46d39e0101f15df8e61d66914c
7
+ data.tar.gz: 62a7496d44a532065c92cf4b8d75971cb3333eb82d7456a6fa9d31529f40327cf720a7115859319dc79182a2020987e7a23512f1551ab36b9336e82241ab02b1
@@ -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,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 2.6.4 (2025-09-11)
6
+
7
+ * Fixed: When using nests_many, nested updates, with preloaded records, using string ids will no longer cause additional DB queries.
8
+
9
+ ## 2.6.3 (2025-08-11)
10
+
11
+ * Fixed: Autosave on associations will triggers saves when only virtual attributes have changed.
12
+ Thanks to @RohanM.
13
+
5
14
  ## 2.6.2 (2025-02-12)
6
15
 
7
16
  * Fixed: Issue with `ActiveType::Object` when using an optional `belongs_to` on a virtual attribute.
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.2)
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.2)
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.2)
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.2)
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.2)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
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.2)
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.2)
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.2)
4
+ active_type (2.6.3)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -85,7 +85,7 @@ The following behaviours are different than in vanilla Rails 5:
85
85
 
86
86
  If you need to use `ActiveRecord's` own `.attribute` method, you can still access is as `ar_attribute`:
87
87
 
88
- ```
88
+ ```rb
89
89
  class User < ApplicationRecord
90
90
  # use my custom type to serialize to the database
91
91
  ar_attribute :password, MyPasswordType.new
@@ -97,7 +97,7 @@ module ActiveType
97
97
  end
98
98
 
99
99
  def fetch_child(parent, id)
100
- assigned = assigned_children(parent).detect { |r| r.id == id }
100
+ assigned = assigned_children(parent).detect { |r| r.id.to_s == id.to_s }
101
101
  return assigned if assigned
102
102
 
103
103
  if child = find_scope(parent).find_by_id(id)
@@ -1,3 +1,3 @@
1
1
  module ActiveType
2
- VERSION = '2.6.2'
2
+ VERSION = '2.6.4'
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)
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.2
4
+ version: 2.6.4
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-02-12 00:00:00.000000000 Z
12
+ date: 2025-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler