1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Check the version of after-commit-everywhere gem

This commit is contained in:
Sergey Tokarenko 2020-05-12 14:21:53 +03:00
parent 86920c68d9
commit 32dc48a55e

View file

@ -30,6 +30,8 @@ module AASM
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