Sha256: 6d622b32d017f531c7d612106a797b36a0b413c987ec158dd854fe87022ac028
Contents?: true
Size: 451 Bytes
Versions: 9
Compression:
Stored size: 451 Bytes
Contents
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
Version data entries
9 entries across 9 versions & 1 rubygems