Module: HasSlug

Defined in:
lib/has_slug.rb

Overview

has_slug is a slugging library for Ruby on Rails

Defined Under Namespace

Modules: ClassMethods, NotSluggableClassMethods, NotSluggableInstanceMethods, SluggableClassMethods, SluggableInstanceMethods

Class Method Summary collapse

Class Method Details

.enableObject

Load has_slug if the gem is included



17
18
19
20
21
# File 'lib/has_slug.rb', line 17

def self.enable
  return if ActiveRecord::Base.methods.include? 'has_slug'
  
  ActiveRecord::Base.class_eval { extend HasSlug::ClassMethods }
end