Module: FriendlyId

Defined in:
lib/friendly_id.rb,
lib/friendly_id/helpers.rb,
lib/friendly_id/version.rb,
lib/friendly_id/shoulda_macros.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods, Helpers, NonSluggableClassMethods, NonSluggableInstanceMethods, ShouldaMacros, SluggableClassMethods, SluggableInstanceMethods, Version Classes: SlugGenerationError

Class Method Summary collapse

Class Method Details

.enableObject

Load FriendlyId if the gem is included in a Rails app.



55
56
57
58
59
# File 'lib/friendly_id.rb', line 55

def enable
  return if ActiveRecord::Base.methods.include? 'has_friendly_id'
  ActiveRecord::Base.class_eval { extend FriendlyId::ClassMethods }
  Test::Unit::TestCase.class_eval { include FriendlyId::ShouldaMacros }
end