Methods

FriendlyId::Scoped::Configuration

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

Attributes

scope[RW]

Gets the scope value.

When setting this value, the argument should be a symbol referencing a belongs_to relation, or a column.

@return Symbol The scope value

Public Instance Methods

scope_columns() click to toggle source

Gets the scope columns.

Checks to see if the :scope option passed to {FriendlyId::Base#friendly_id} refers to a relation, and if so, returns the realtion's foreign key. Otherwise it assumes the option value was the name of column and returns it cast to a String.

@return String The scope column

# File lib/friendly_id/scoped.rb, line 138
def scope_columns
  [@scope].flatten.map { |s| (reflection_foreign_key(s) or s).to_s }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.