snfoil 0.5.5 → 0.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfab0f49425b4cd1ba02f48f0c3bc114e45fd061118d9673740f2ec05b7655e2
|
4
|
+
data.tar.gz: 9c66aac6b0edf869f8243db1c447c5e0ef4df1162734c086dfe26fde86427e74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 239615bc72acaa404521d0771fddaf05a7489cbbf7d9f8b5f1ba8e271c4cb520a2146bdeaf153e933c1c34d83b662a72ebe41f2fd3162825bbd52615fa6b5d8d
|
7
|
+
data.tar.gz: b4ac4f458812bfce5002e30103f35a30fc44a8509c3ec3cfb8fa86e612d2fa6f48ada5b34713c29e4910ae321477fbc9bfffdc4e47468121424523f33ba8c3db
|
@@ -70,7 +70,7 @@ module SnFoil
|
|
70
70
|
options = setup_create_object(**options)
|
71
71
|
authorize(options[:object], :create?, **options)
|
72
72
|
options = create_hooks(**options)
|
73
|
-
|
73
|
+
options[:object]
|
74
74
|
end
|
75
75
|
|
76
76
|
def setup_create(**options)
|
@@ -127,7 +127,9 @@ module SnFoil
|
|
127
127
|
# This method is private to help protect the order of execution of hooks
|
128
128
|
def create_hooks(options)
|
129
129
|
options = before_create_save(**options)
|
130
|
-
|
130
|
+
save_successful = options[:object].save
|
131
|
+
options.merge!(object: unwrap_object(options[:object]))
|
132
|
+
options = if save_successful
|
131
133
|
after_create_save_success(**options)
|
132
134
|
else
|
133
135
|
after_create_save_failure(**options)
|
@@ -121,7 +121,9 @@ module SnFoil
|
|
121
121
|
# This method is private to help protect the order of execution of hooks
|
122
122
|
def destroy_hooks(options)
|
123
123
|
options = before_destroy_save(options)
|
124
|
-
|
124
|
+
destroy_successful = options[:object].destroy
|
125
|
+
options.merge!(object: unwrap_object(options[:object]))
|
126
|
+
options = if destroy_successful
|
125
127
|
after_destroy_save_success(options)
|
126
128
|
else
|
127
129
|
after_destroy_save_failure(options)
|
@@ -124,7 +124,9 @@ module SnFoil
|
|
124
124
|
# This method is private to help protect the order of execution of hooks
|
125
125
|
def update_hooks(options)
|
126
126
|
options = before_update_save(options)
|
127
|
-
|
127
|
+
update_successful = options[:object].save
|
128
|
+
options.merge!(object: unwrap_object(options[:object]))
|
129
|
+
options = if update_successful
|
128
130
|
after_update_save_success(options)
|
129
131
|
else
|
130
132
|
after_update_save_failure(options)
|
data/lib/sn_foil/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snfoil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Howes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-07-
|
12
|
+
date: 2020-07-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|