mirror of
https://github.com/activerecord-hackery/ransack.git
synced 2022-11-09 13:47:45 -05:00
4538c5d905
Instead, require a minimum of Rails 5.2.1.
19 lines
647 B
Ruby
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
|