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



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

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

#slug_columnObject

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



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

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

#slug_generator_classObject

Returns the value of attribute slug_generator_class.



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

def slug_generator_class
  @slug_generator_class
end

#slug_limitObject

The limit that will be used for slug.



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

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.



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

def query_field
  slug_column
end