Sha256: f3b344c892b645f13ec42701d6e0c23ebfb27687796cc506ec1fe7d11214eb03
Contents?: true
Size: 381 Bytes
Versions: 49
Compression:
Stored size: 381 Bytes
Contents
# encoding: UTF-8 module GovspeakSmartQuotesFixer def self.included(model) model.class_eval do before_validation :fix_smart_quotes_in_govspeak end end private def fix_smart_quotes_in_govspeak self.class::GOVSPEAK_FIELDS.each do |field| if self.send(field) =~ /[“”]/ self.send(field).gsub!(/[“”]/, '"') end end end end
Version data entries
49 entries across 49 versions & 1 rubygems