Module: FriendlyId::Slugged::Configuration

Defined in:
lib/friendly_id/slugged.rb

Overview

This module adds the :slug_column, and :slug_limit, and :sequence_separator, and :slug_generator_class configuration options to FriendlyId::Configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sequence_separatorObject

The string used to separate a slug base from a numeric sequence.

You can change the default separator by setting the sequence_separator configuration option.

Returns:

  • String The sequence separator string. Defaults to "-".


404
405
406
# File 'lib/friendly_id/slugged.rb', line 404

def sequence_separator
  @sequence_separator ||= defaults[:sequence_separator]
end

#slug_columnObject

The column that will be used to store the generated slug.


409
410
411
# File 'lib/friendly_id/slugged.rb', line 409

def slug_column
  @slug_column ||= defaults[:slug_column]
end

#slug_generator_classObject

Returns the value of attribute slug_generator_class


390
391
392
# File 'lib/friendly_id/slugged.rb', line 390

def slug_generator_class
  @slug_generator_class
end

#slug_limitObject

The limit that will be used for slug.


414
415
416
# File 'lib/friendly_id/slugged.rb', line 414

def slug_limit
  @slug_limit ||= defaults[:slug_limit]
end

Instance Method Details

#query_fieldObject

Makes FriendlyId use the slug column for querying.

Returns:

  • String The slug column.


394
395
396
# File 'lib/friendly_id/slugged.rb', line 394

def query_field
  slug_column
end