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
5b6be565
Commit
5b6be565
authored
Nov 28, 2019
by
Ashwin Hegde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trigger_transactional_callbacks if paranoia destroyed
parent
a4da86d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
lib/paranoia.rb
+5
-1
No files found.
lib/paranoia.rb
View file @
5b6be565
...
...
@@ -69,7 +69,7 @@ module Paranoia
next
unless
send
(
association
.
reflection
.
name
)
association
.
decrement_counters
end
@_trigger_
update
_callback
=
true
@_trigger_
destroy
_callback
=
true
@_disable_counter_cache
=
false
result
end
...
...
@@ -82,6 +82,10 @@ module Paranoia
raise
(
ActiveRecord
::
RecordNotDestroyed
.
new
(
"Failed to destroy the record"
,
self
))
end
def
trigger_transactional_callbacks?
super
||
@_trigger_destroy_callback
&&
paranoia_destroyed?
end
def
paranoia_delete
raise
ActiveRecord
::
ReadOnlyRecord
,
"
#{
self
.
class
}
is marked as readonly"
if
readonly?
if
persisted?
...
...
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