diff --git a/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb b/lib/polyamorous/activerecord/join_association.rb similarity index 100% rename from lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb rename to lib/polyamorous/activerecord/join_association.rb diff --git a/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb b/lib/polyamorous/activerecord/join_dependency.rb similarity index 100% rename from lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb rename to lib/polyamorous/activerecord/join_dependency.rb diff --git a/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb b/lib/polyamorous/activerecord/reflection.rb similarity index 100% rename from lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb rename to lib/polyamorous/activerecord/reflection.rb diff --git a/lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb b/lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb deleted file mode 100644 index 793116428..000000000 --- a/lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb +++ /dev/null @@ -1 +0,0 @@ -require 'polyamorous/activerecord_6.1_ruby_2/join_association' diff --git a/lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb b/lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb deleted file mode 100644 index 6609b0db8..000000000 --- a/lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb +++ /dev/null @@ -1 +0,0 @@ -require 'polyamorous/activerecord_6.1_ruby_2/join_dependency' diff --git a/lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb b/lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb deleted file mode 100644 index 685ee2f92..000000000 --- a/lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb +++ /dev/null @@ -1 +0,0 @@ -require 'polyamorous/activerecord_6.1_ruby_2/reflection' diff --git a/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb b/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb deleted file mode 100644 index 793116428..000000000 --- a/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb +++ /dev/null @@ -1 +0,0 @@ -require 'polyamorous/activerecord_6.1_ruby_2/join_association' diff --git a/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb b/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb deleted file mode 100644 index 6609b0db8..000000000 --- a/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb +++ /dev/null @@ -1 +0,0 @@ -require 'polyamorous/activerecord_6.1_ruby_2/join_dependency' diff --git a/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb b/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb deleted file mode 100644 index 685ee2f92..000000000 --- a/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb +++ /dev/null @@ -1 +0,0 @@ -require 'polyamorous/activerecord_6.1_ruby_2/reflection' diff --git a/lib/polyamorous/polyamorous.rb b/lib/polyamorous/polyamorous.rb index 8b9074dd9..032f71711 100644 --- a/lib/polyamorous/polyamorous.rb +++ b/lib/polyamorous/polyamorous.rb @@ -11,10 +11,9 @@ module Polyamorous require 'polyamorous/join' require 'polyamorous/swapping_reflection_class' - ar_version = ::ActiveRecord::VERSION::STRING[0, 3] - %w(join_association join_dependency reflection).each do |file| - require "polyamorous/activerecord_#{ar_version}_ruby_2/#{file}" - end + require 'polyamorous/activerecord/join_association' + require 'polyamorous/activerecord/join_dependency' + require 'polyamorous/activerecord/reflection' ActiveRecord::Reflection::AbstractReflection.send(:prepend, Polyamorous::ReflectionExtensions)