# frozen_string_literal: true # Almacena una contraseƱa class MetadataPassword < MetadataString include Metadata::NonIndexableConcern private alias_method :original_sanitize, :sanitize # Sanitizar la string y generar un hash Bcrypt # # @param :string [String] # @return [String] def sanitize(string) string = original_sanitize string ::BCrypt::Password.create(string).to_s end end