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
6972b229
Commit
6972b229
authored
Dec 12, 2016
by
Ben A. Morgan
Committed by
GitHub
Dec 12, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #371 from iaankrynauw/core
Use ActiveSupport.on_load to correctly re-open ActiveRecord::Base
parents
b5b38231
49b9e68e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
lib/paranoia.rb
+3
-1
No files found.
lib/paranoia.rb
View file @
6972b229
...
@@ -205,7 +205,8 @@ module Paranoia
...
@@ -205,7 +205,8 @@ module Paranoia
end
end
end
end
class
ActiveRecord
::
Base
ActiveSupport
.
on_load
(
:active_record
)
do
class
ActiveRecord
::
Base
def
self
.
acts_as_paranoid
(
options
=
{})
def
self
.
acts_as_paranoid
(
options
=
{})
alias_method
:really_destroyed?
,
:destroyed?
alias_method
:really_destroyed?
,
:destroyed?
alias_method
:really_delete
,
:delete
alias_method
:really_delete
,
:delete
...
@@ -256,6 +257,7 @@ class ActiveRecord::Base
...
@@ -256,6 +257,7 @@ class ActiveRecord::Base
def
paranoia_sentinel_value
def
paranoia_sentinel_value
self
.
class
.
paranoia_sentinel_value
self
.
class
.
paranoia_sentinel_value
end
end
end
end
end
require
'paranoia/rspec'
if
defined?
RSpec
require
'paranoia/rspec'
if
defined?
RSpec
...
...
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