Module: ConcernsOnRails::Models::Sluggable

Extended by:
ActiveSupport::Concern
Defined in:
lib/concerns_on_rails/models/sluggable.rb

Instance Method Summary collapse

Instance Method Details

#slug_sourceObject

Instance methods Returns the source for the slug we are calling the class attribute, so we can use it in the lambda Example:

record.slug_source


56
57
58
59
# File 'lib/concerns_on_rails/models/sluggable.rb', line 56

def slug_source
  field = self.class.sluggable_field
  respond_to?(field) ? send(field) : to_s
end