Sha256: 0897ef7dabbc9b49b687cb3af7b941e93cab6c0ecf8c5d748a73d7ea1c9f5592
Contents?: true
Size: 457 Bytes
Versions: 23
Compression:
Stored size: 457 Bytes
Contents
module Adminpanel module Friendly extend ActiveSupport::Concern included do extend FriendlyId friendly_id :slug_candidates, use: :slugged before_validation :make_slug_nil, if: Proc.new { |object| object.name_changed? }, prepend: true end private def slug_candidates [ :name, :id ] end def make_slug_nil self.slug = nil end end end
Version data entries
23 entries across 23 versions & 1 rubygems