Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'v1'

  • Loading branch information...
commit e83018c1eb756f6c37a501c5d9a7bc60e2a9a0e1 2 parents 67e1684 + b704446
@pat pat authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/thinking_sphinx/facet.rb
View
9 lib/thinking_sphinx/facet.rb
@@ -104,7 +104,14 @@ def translate(object, attribute_value)
method = value_source || column.__name
object = objects.one? ? objects.first : objects.detect { |item|
result = item.send(method)
- result && result.to_crc32 == attribute_value
+ case result
+ when String
+ result.to_crc32 == attribute_value
+ when NilClass
+ false
+ else
+ result == attribute_value
+ end
}
object.try(method)
Please sign in to comment.
Something went wrong with that request. Please try again.