dependent-auto-rails 0.2.0 → 0.2.1

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: 4bace913fbaee41d6bd8330049633d641488b44e15d6881c8cb59c3e236e992d
4
- data.tar.gz: 0c4d1c52f650c89d701df483e7e4fa430cf4c0ca4a77c6b5c14946a101d48591
3
+ metadata.gz: 6440f408848bb2bae6587ac5e84a6c1b8025e083d43bc0536512727fb11a6fcd
4
+ data.tar.gz: f2eda5a45cf5facbeb02ca99801fc1e6493083423bb06904ff05b2d89cb99af8
5
5
  SHA512:
6
- metadata.gz: 62a535b5da5d1f75c73a650b3505f0f5d51b60ce1b2b66bec050670b855f5756dd9bb8b6a9f559016366e834c0a8c8a5000f1330dba9ec87062e3dd7e801f204
7
- data.tar.gz: aa0cabec1f5a7eebb977c85f9b98e30872c2e0c7acb8d7e6ec08ff642239bff43c5a153d8cec81ed0ca31d5e964d571eb98fd60f1a6fb6416c167d0b0bbca86c
6
+ metadata.gz: 0f90fa81d2ea2a0a4478d380cfd9edc38fea534e5b88e975393c3c86ee43464fefb34dda23dd6a94d67abaf37a792e4002f2a1830c77d00ec7dce50322bf16e7
7
+ data.tar.gz: 2f9bfe5254002c37726e70aeb40067686f2277c1a76372fb5086a524fbb30fac85311f450cf77f817ea6fd890f4a1bb8082dcafb8afc4c3269a79fec36902bf1
data/README.md CHANGED
@@ -3,11 +3,11 @@
3
3
 
4
4
  # dependent-auto-rails
5
5
 
6
- This gem provides a new `dependent` option for ActiveRecord associations, `:auto`. Using this option will automatically select between `:destroy` and `:delete` / `:delete_all` during runtime based on whether or not the associated model has any callbacks defined which would usually be executed as part of the destroy lifecycle. This is useful since `dependent: :destroy` always initialises the associated records in order to execute their callbacks regardless of whether or not there are any defined, but is often the go-to option since it is the safest. This can be expensive if there are many records to destroy.
6
+ This gem provides a new `dependent` option for ActiveRecord associations, `:auto`. Using this option will automatically select between `:destroy` and `:delete` / `:delete_all` during runtime based on whether or not the associated model has any callbacks defined which would usually be executed as part of the destroy lifecycle.
7
7
 
8
- It is also useful since a model's associations are rarely updated, but it's business logic can change frequently. This means that if destroy callbacks are added or removed on the associated model, the `dependent` option on the parent model's association may need to be updated to reflect this. Using `dependent: :auto` will automatically select the appropriate `dependent` option based on the current state of the model.
8
+ This is useful since `dependent: :destroy` always initialises the associated records in order to execute their callbacks regardless of whether or not there are any defined, but is often the go-to option since it is the safest. This can be expensive if there are many records to destroy.
9
9
 
10
- If you're looking for a solution with little less magic, check out https://github.com/gregnavis/active_record_doctor's `incorrect_dependent_option` detector.
10
+ It is also useful since a model's associations are rarely updated, but it's business logic can change frequently. This means that if destroy callbacks are added or removed on the associated model, the `dependent` option on the parent model's association may need to be updated to reflect this. Using `dependent: :auto` will automatically select the appropriate `dependent` option based on the current state of the model.
11
11
 
12
12
  **NOTE**: The `:auto` option **ONLY** decides between `:destroy` and `:delete` / `:delete_all`. It does not use any of the other `dependent` options:
13
13
  - `:nullify`
@@ -17,6 +17,8 @@ If you're looking for a solution with little less magic, check out https://githu
17
17
 
18
18
  **NOTE**: If for some reason the `:auto` option is unable to decide between `:destroy` and `:delete` / `:delete_all`, it will default to `:destroy`.
19
19
 
20
+ **INFO**: If you're looking for a solution with a little less magic, check out the `incorrect_dependent_option` detector provided by https://github.com/gregnavis/active_record_doctor.
21
+
20
22
  ## Installation
21
23
 
22
24
  Install the gem and add it to the application's Gemfile by executing:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DependentAutoRails
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependent-auto-rails
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
  - Joshua Young