Skip to content

Commit

Permalink
Check the version of after-commit-everywhere gem
Browse files Browse the repository at this point in the history
  • Loading branch information
stokarenko committed May 12, 2020
1 parent 86920c6 commit 32dc48a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/aasm/persistence/active_record_persistence.rb
Expand Up @@ -30,6 +30,8 @@ module ActiveRecordPersistence
def self.included(base)
begin
require 'after_commit_everywhere'
raise LoadError unless Gem::Version.new(::AfterCommitEverywhere::VERSION) >= Gem::Version.new('0.1.5')

base.send(:include, ::AfterCommitEverywhere) unless base.include?(::AfterCommitEverywhere)
base.send(:alias_method, :aasm_execute_after_commit, :after_commit)
rescue LoadError
Expand Down

0 comments on commit 32dc48a

Please sign in to comment.