Sha256: aaa5f05e2b78b77d9e723eb6a85177efeccc90fba6ed34e9cafd47d08124aae0
Contents?: true
Size: 464 Bytes
Versions: 11
Compression:
Stored size: 464 Bytes
Contents
module Alchemy module Custom module Model module SlugOptimizer extend ActiveSupport::Concern included do validates friendly_id_config.query_field, uniqueness: {:allow_nil => true} before_save :prevent_wrong_slug private def prevent_wrong_slug self.send("#{friendly_id_config.query_field}=", normalize_friendly_id(self.slug)) end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems