Fix string constants

Fixes #457 (hopefully)
This commit is contained in:
Jon Atack 2014-10-29 23:37:34 +01:00
parent 0e9f56cbba
commit 06ab10070d
1 changed files with 5 additions and 5 deletions

View File

@ -158,7 +158,7 @@ module Ransack
def get_association(str, parent = @base)
klass = klassify parent
ransackable_association?(str, klass) &&
klass.reflect_on_all_associations.detect { |a| a.name.to_s == str }
klass.reflect_on_all_associations.detect { |a| a.name.to_s == str }
end
def join_dependency(relation)
@ -175,13 +175,13 @@ module Ransack
buckets = relation.joins_values.group_by do |join|
case join
when String
STRING_JOIN
Ransack::Constants::STRING_JOIN
when Hash, Symbol, Array
ASSOCIATION_JOIN
Ransack::Constants::ASSOCIATION_JOIN
when JoinDependency, JoinDependency::JoinAssociation
STASHED_JOIN
Ransack::Constants::STASHED_JOIN
when Arel::Nodes::Join
JOIN_NODE
Ransack::Constants::JOIN_NODE
else
raise 'unknown class: %s' % join.class.name
end