1
0
Fork 0
mirror of https://github.com/activerecord-hackery/ransack.git synced 2022-11-09 13:47:45 -05:00
activerecord-hackery--ransack/spec/helpers/polyamorous_helper.rb
David Rodríguez 4538c5d905
Drop Rails 5.2.0 support as well
Instead, require a minimum of Rails 5.2.1.
2019-10-31 10:00:44 +01:00

19 lines
647 B
Ruby

module PolyamorousHelper
def new_join_association(reflection, children, klass)
Polyamorous::JoinAssociation.new reflection, children, klass
end
if ActiveRecord.version >= ::Gem::Version.new("6.0.0.rc1")
def new_join_dependency(klass, associations = {})
Polyamorous::JoinDependency.new klass, klass.arel_table, associations, Polyamorous::InnerJoin
end
else
def new_join_dependency(klass, associations = {})
Polyamorous::JoinDependency.new klass, klass.arel_table, associations
end
end
def new_join(name, type = Polyamorous::InnerJoin, klass = nil)
Polyamorous::Join.new name, type, klass
end
end