module Mongoid::Giza::Index::Common

Common routines to fields and attributes

Public Instance Methods

normalize(s) click to toggle source

Replaces all non-alphabetical characters and converts to lower case

@param s [Symbol, String] symbol or string to be normalized

@return [Symbol] the normalized symbol

# File lib/mongoid/giza/index/common.rb, line 13
def normalize(s)
  s.to_s.gsub(/[^[:alpha:]_-]/, "-").mb_chars.downcase.to_sym
end