active_record-nested_attributes-destroy_if 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50b904d94bc808cae78828f9bb7342c9c4a96e1e21c93be7ee654265861738a2
4
- data.tar.gz: 603cd946586e2b2e85e11d0435f89d559bd44fac977277c35e8c48a8dad348d0
3
+ metadata.gz: bb8fdfa9077353df3588817a550c8d311b8b6827337f3e76b7dcaa7f6f2cd1d7
4
+ data.tar.gz: 25205f8a4dda44acb15092e26304c7b7394ce736468f1dcaa139d7e3f235c463
5
5
  SHA512:
6
- metadata.gz: 2f9e8ab2c4f6ed9c7751bbda6ac3707bb2d9e17fc5edd43a351a2ac253c1b56995331f3848572973683a09441ea28dff760b17f133942ce9b112bcced0cf7386
7
- data.tar.gz: 3eb9ef1dae8e13b777e7b81fd1283d17a0e28a9111671eec0e57bcd418d2929414e85a81ce153e01c568d92361165cded572f767c0e29993b8ccc16f4d18c4cb
6
+ metadata.gz: 41c6e6afa3e0b47092c144207586bc3ed0e0b065237e79db3653907b9ff9ee4c93dd3f87287c8ed77f6bd5dd052cf9d16a41eec4d3d4f985cf7d4a8be7d69ef6
7
+ data.tar.gz: 5b5d1274cb6a4609a920877b65a8f801f690da96439712683ee935675c15c81bfdb357fbeb5a3c4f5ed8df5e3b621365b4de3042acad3bbc0d645092a0b9c3fc
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ActiveRecord::NestedAttributes::DestroyIf
2
2
 
3
- [![Build Status](https://travis-ci.org/botandrose/active_record-nested_attributes-destroy_if.svg?branch=master)](https://travis-ci.org/botandrose/active_record-nested_attributes-destroy_if)
3
+ [![CI Status](https://github.com/botandrose/active_record-nested_attributes-destroy_if/workflows/CI/badge.svg?branch=master)](https://github.com/botandrose/active_record-nested_attributes-destroy_if/actions?query=workflow%3ACI+branch%3Amaster)
4
4
 
5
5
  Adds a `:destroy_if` option to `.accepts_nested_attributes_for`, which is basically a stronger version of `:reject_if` that also destroys existing records.
6
6
 
@@ -1,6 +1,6 @@
1
1
  module ActiveRecord
2
2
  module NestedAttributesDestroyIf
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
6
6
 
@@ -11,7 +11,7 @@ module ActiveRecord
11
11
  options = { allow_destroy: false, update_only: false }
12
12
  options.update(attr_names.extract_options!)
13
13
  options.assert_valid_keys(:allow_destroy, :reject_if, :destroy_if, :limit, :update_only)
14
- options[:reject_if] = REJECT_ALL_BLANK_PROC if options[:reject_if] == :all_blank
14
+ options[:reject_if] = ActiveRecord::NestedAttributes::ClassMethods::REJECT_ALL_BLANK_PROC if options[:reject_if] == :all_blank
15
15
 
16
16
  attr_names.each do |association_name|
17
17
  if reflection = _reflect_on_association(association_name)
@@ -114,7 +114,7 @@ module ActiveRecord
114
114
  if target_record
115
115
  existing_record = target_record
116
116
  else
117
- association.add_to_target(existing_record, :skip_callbacks)
117
+ association.add_to_target(existing_record, skip_callbacks: true)
118
118
  end
119
119
 
120
120
  assign_to_or_mark_for_destruction(existing_record, attributes, options[:allow_destroy], options[:destroy_if])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-nested_attributes-destroy_if
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-26 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