active_record_compose 0.2.0 → 0.2.1

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: 6693618ddc81944ece9c991f800ba8ce1ef5b7f462b13bfe0c9f4b03b04bdc6f
4
- data.tar.gz: 36cc7ec0a5852c409dab736d21058f2538c3a656e893d37a7ec8bf2ae499f2cb
3
+ metadata.gz: 0c3cb23854b3caafb1f25c297b1d12fb7693c5af5d8e7f917ce3117e5334afa0
4
+ data.tar.gz: fe905d6071cc4c491fadd68c35b36540b57881d78b6c398acaf2e573d766912c
5
5
  SHA512:
6
- metadata.gz: 2780e3749043f5667bcd1a693c248f0c3f2378f7cb8d221f636ada171ab4c5b03c7baa2c479e381ab73570352fabd5c1fb623d9d3ca79b8718919bbe77f5fffe
7
- data.tar.gz: 4f6eec237d85851c0eb6041dacb2ea8c2000c431bfe4c632e11647e3009a0d9745bcb572b492ff71e07baa03c298faecb9406d76b939468f0d21cb4315c3eb04
6
+ metadata.gz: 6a8850ebb01e4705f658bbc65c2cc10366214a2c34787b3d6c6228c34ac405aa00b548212747ef5429fe26eabe1633bf5af9d1019bd95094c1cfd79897811d4c
7
+ data.tar.gz: a531f7980d9d5ed490aa8c35927176511db6ff81f81009d02ac4121a04abe57efd6ac4dc5db8f353b4ef03c18214c73f246a1c6c8e43e235d1065d436538de31
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2024-01-31
4
+
5
+ - in `#save` (without bang), `ActiveRecord::RecordInvalid` error is not passed outward.
6
+
3
7
  ## [0.2.0] - 2024-01-21
4
8
 
5
9
  - add i18n doc.
@@ -34,6 +34,8 @@ module ActiveRecordCompose
34
34
  return false if invalid?
35
35
 
36
36
  save_in_transaction { save_models(bang: false) }
37
+ rescue ActiveRecord::RecordInvalid
38
+ false
37
39
  end
38
40
 
39
41
  # Save the models that exist in models.
@@ -77,6 +79,8 @@ module ActiveRecordCompose
77
79
  return false if invalid?
78
80
 
79
81
  save_in_transaction { run_callbacks(:create) { save_models(bang: false) } }
82
+ rescue ActiveRecord::RecordInvalid
83
+ false
80
84
  end
81
85
 
82
86
  # Behavior is same to `#create`, but raises an exception prematurely on failure.
@@ -118,6 +122,8 @@ module ActiveRecordCompose
118
122
  return false if invalid?
119
123
 
120
124
  save_in_transaction { run_callbacks(:update) { save_models(bang: false) } }
125
+ rescue ActiveRecord::RecordInvalid
126
+ false
121
127
  end
122
128
 
123
129
  # Behavior is same to `#update`, but raises an exception prematurely on failure.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordCompose
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - hamajyotan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-20 00:00:00.000000000 Z
11
+ date: 2024-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -51,7 +51,7 @@ metadata:
51
51
  homepage_uri: https://github.com/hamajyotan/active_record_compose
52
52
  source_code_uri: https://github.com/hamajyotan/active_record_compose
53
53
  changelog_uri: https://github.com/hamajyotan/active_record_compose/blob/main/CHANGELOG.md
54
- documentation_uri: https://www.rubydoc.info/gems/active_record_compose/0.2.0
54
+ documentation_uri: https://www.rubydoc.info/gems/active_record_compose/0.2.1
55
55
  rubygems_mfa_required: 'true'
56
56
  post_install_message:
57
57
  rdoc_options: []