Module: ConcernsOnRails::Models::Sluggable

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

Defined Under Namespace

Modules: ClassMethods

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


111
112
113
114
# File 'lib/concerns_on_rails/models/sluggable.rb', line 111

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