Skip to content

Commit

Permalink
Fix crash with ruby < 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
aymeric-ledorze committed Aug 1, 2018
1 parent 824e044 commit 7c34449
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/acts_as_paranoid/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module Core
def self.included(base)
base.extend ClassMethods
if ActiveRecord::VERSION::MAJOR > 5 || (ActiveRecord::VERSION::MAJOR == 5 && (ActiveRecord::VERSION::MINOR >= 2 || (ActiveRecord::VERSION::MINOR == 2 && ActiveRecord::VERSION::TINY >= 1)))
base.alias_method :remember_transaction_record_state_without_paranoid, :remember_transaction_record_state
base.alias_method :remember_transaction_record_state, :remember_transaction_record_state_with_paranoid
base.send(:alias_method, :remember_transaction_record_state_without_paranoid, :remember_transaction_record_state)
base.send(:alias_method, :remember_transaction_record_state, :remember_transaction_record_state_with_paranoid)
end
base.alias_method :force_clear_transaction_record_state_without_paranoid, :force_clear_transaction_record_state
base.alias_method :force_clear_transaction_record_state, :force_clear_transaction_record_state_with_paranoid
base.send(:alias_method, :force_clear_transaction_record_state_without_paranoid, :force_clear_transaction_record_state)
base.send(:alias_method, :force_clear_transaction_record_state, :force_clear_transaction_record_state_with_paranoid)
end

module ClassMethods
Expand Down

0 comments on commit 7c34449

Please sign in to comment.