Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (17 sloc) 0.451 kb
module Plucky
module Normalizers
class CriteriaHashKey
# Public: Returns key normalized for Mongo
#
# key - The key to normalize
#
# Returns key as Symbol if possible, else key with no changes
def call(key)
key = key.to_sym if key.respond_to?(:to_sym)
return call(key.field) if key.respond_to?(:field)
return :_id if key == :id
key
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.