lib/friendly_id/configuration.rb
# Lets you specify the addon modules to use with FriendlyId.
#
# This method is invoked by {FriendlyId::Base#friendly_id friendly_id} when
# passing the `:use` option, or when using {FriendlyId::Base#friendly_id
# friendly_id} with a block.
#
# @example
#   class Book < ActiveRecord::Base
#     extend FriendlyId
#     friendly_id :name, :use => :slugged
#   end
#
# @param [#to_s,Module] modules Arguments should be Modules, or symbols or
#   strings that correspond with the name of an addon to use with FriendlyId.
#   By default FriendlyId provides `:slugged`, `:finders`, `:history`,
#   `:reserved`, `:simple_i18n`, and `:scoped`.
Lets you specify the addon modules to use with FriendlyId.
Lets you specify the addon modules to use with FriendlyId .
def use(*modules)
      modules.to_a.flatten.compact.map do |object|
        mod = get_module(object)
        mod.setup(@model_class) if mod.respond_to?(:setup)
        @model_class.send(:include, mod) unless uses? object
      end
    end
def use ( * modules ) modules . to_a . flatten . compact . map do | object | mod = get_module ( object ) mod . setup ( @model_class ) if mod . respond_to? ( :setup ) @model_class . send ( :include , mod ) unless uses? object end end
Lets you specify the addon modules to use with FriendlyId.
Lets you specify the addon modules to use with FriendlyId .
modules
modules Arguments should be Modules, or symbols or strings that correspond with the name of an addon to use with FriendlyId. By default FriendlyId provides `:slugged`, `:finders`, `:history`, `:reserved`, `:simple_i18n`, and `:scoped`.
modules Arguments should be Modules or symbols or strings that correspond with the name of an addon to use with FriendlyId . By default FriendlyId provides ` : slugged ` ` : finders ` ` : history ` ` : reserved ` ` : simple_i18n ` and ` : scoped ` .
example
class Book < ActiveRecord::Base extend FriendlyId friendly_id :name, :use => :slugged end
class Book < ActiveRecord :: Base extend FriendlyId friendly_id : name : use = > : slugged end