From 7c344494e6ae6422f777903be4694b6dfedc2bc5 Mon Sep 17 00:00:00 2001 From: Aymeric Le Dorze Date: Wed, 1 Aug 2018 18:03:25 +0200 Subject: [PATCH] Fix crash with ruby < 2.5 --- lib/acts_as_paranoid/core.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/acts_as_paranoid/core.rb b/lib/acts_as_paranoid/core.rb index f632f4eb..510062d1 100644 --- a/lib/acts_as_paranoid/core.rb +++ b/lib/acts_as_paranoid/core.rb @@ -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