Skip to content

Commit 5f8fda5

Browse files
authored
Merge pull request #1 from Current-RMS/to_sym_patch
Resolve to_sym on nil error
2 parents 4e5cf5f + 6bee239 commit 5f8fda5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/ransack/context.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def unpolymorphize_association(str)
152152
end
153153

154154
def ransackable_alias(str)
155+
return nil if str.nil?
155156
klass._ransack_aliases.fetch(str, klass._ransack_aliases.fetch(str.to_sym, str))
156157
end
157158

0 commit comments

Comments
 (0)