load 5.2.1 polyamorous files for >= 5.2.1

This commit is contained in:
Greg Molnar 2018-11-29 16:43:54 +01:00
parent 457a371dc2
commit 09615bc0f6
1 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,8 @@ if defined?(::ActiveRecord)
require 'polyamorous/swapping_reflection_class'
ar_version = ::ActiveRecord::VERSION::STRING[0,3]
ar_version = ::ActiveRecord::VERSION::STRING[0,5] if ar_version >= '5.2'
ar_version = ::ActiveRecord::VERSION::STRING[0,5] if ar_version >= "5.2"
ar_version = "5.2.1" if ::ActiveRecord::VERSION::STRING >= "5.2.1"
%w(join_association join_dependency).each do |file|
require "polyamorous/activerecord_#{ar_version}_ruby_2/#{file}"