Skip to content

Commit

Permalink
More accurate ActiveRecord version number for fix multiple calls to a…
Browse files Browse the repository at this point in the history
…fter_destroy_commit callbacks
  • Loading branch information
aymeric-ledorze committed Aug 1, 2018
1 parent 5627a8b commit 824e044
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/acts_as_paranoid/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ActsAsParanoid
module Core
def self.included(base)
base.extend ClassMethods
if ActiveRecord::VERSION::MAJOR > 5 || (ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR >= 2)
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
end
Expand Down Expand Up @@ -246,7 +246,7 @@ def stale_paranoid_value
clear_attribute_changes([self.class.paranoid_column])
end

if ActiveRecord::VERSION::MAJOR > 5 || (ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR >= 2)
if ActiveRecord::VERSION::MAJOR > 5 || (ActiveRecord::VERSION::MAJOR == 5 && (ActiveRecord::VERSION::MINOR >= 2 || (ActiveRecord::VERSION::MINOR == 2 && ActiveRecord::VERSION::TINY >= 1)))
def remember_transaction_record_state_with_paranoid
remember_transaction_record_state_without_paranoid
remember_trigger_destroy_callback_before_last_commit
Expand Down

0 comments on commit 824e044

Please sign in to comment.