Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paranoia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paranoia
Commits
a4da86d0
Commit
a4da86d0
authored
Nov 28, 2019
by
Ashwin Hegde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix after commit for rails 6
parent
0600183a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
lib/paranoia.rb
+1
-0
test/paranoia_test.rb
+15
-0
No files found.
lib/paranoia.rb
View file @
a4da86d0
...
...
@@ -69,6 +69,7 @@ module Paranoia
next
unless
send
(
association
.
reflection
.
name
)
association
.
decrement_counters
end
@_trigger_update_callback
=
true
@_disable_counter_cache
=
false
result
end
...
...
test/paranoia_test.rb
View file @
a4da86d0
...
...
@@ -131,6 +131,21 @@ class ParanoiaTest < test_framework
assert
model
.
instance_variable_get
(
:@after_commit_callback_called
)
end
def
test_destroy_behavior_for_freshly_loaded_plain_models_callbacks
model
=
CallbackModel
.
new
model
.
save
model
=
CallbackModel
.
find
(
model
.
id
)
model
.
destroy
assert_nil
model
.
instance_variable_get
(
:@update_callback_called
)
assert_nil
model
.
instance_variable_get
(
:@save_callback_called
)
assert_nil
model
.
instance_variable_get
(
:@validate_called
)
assert
model
.
instance_variable_get
(
:@destroy_callback_called
)
assert
model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert
model
.
instance_variable_get
(
:@after_commit_callback_called
)
end
def
test_delete_behavior_for_plain_models_callbacks
model
=
CallbackModel
.
new
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment