FriendlyId::Reserved::Configuration

This module adds the :reserved_words configuration option to {FriendlyId::Configuration FriendlyId::Configuration}.

Attributes

reserved_words[W]

Public Instance Methods

base=(base) click to toggle source

Overrides {FriendlyId::Configuration#base} to add a validation to the model class.

# File lib/friendly_id/reserved.rb, line 56
def base=(base)
  super
  reserved_words = model_class.friendly_id_config.reserved_words
  model_class.validates_exclusion_of :friendly_id, :in => reserved_words
end
reserved_words() click to toggle source

An array of words forbidden as slugs.

# File lib/friendly_id/reserved.rb, line 63
def reserved_words
  @reserved_words ||= @defaults[:reserved_words]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.