Module: FriendlyId::Slugged::Configuration

Defined in:
lib/friendly_id/slugged.rb

Overview

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

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) sequence_separator

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 "-".



344
345
346
# File 'lib/friendly_id/slugged.rb', line 344

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

- (Object) slug_column

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



349
350
351
# File 'lib/friendly_id/slugged.rb', line 349

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

- (Object) slug_generator_class

Returns the value of attribute slug_generator_class



330
331
332
# File 'lib/friendly_id/slugged.rb', line 330

def slug_generator_class
  @slug_generator_class
end

Instance Method Details

- (Object) query_field

Makes FriendlyId use the slug column for querying.

Returns:

  • String The slug column.



334
335
336
# File 'lib/friendly_id/slugged.rb', line 334

def query_field
  slug_column
end