Commit 6972b229 by Ben A. Morgan Committed by GitHub

Merge pull request #371 from iaankrynauw/core

Use ActiveSupport.on_load to correctly re-open ActiveRecord::Base
parents b5b38231 49b9e68e
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment