Sha256: 541941085e00f67379b711907f9b3854109eb165e07f139476b3bc0aa918baba

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

module Slugs
  class Railtie < Rails::Railtie

    initializer 'slugs.extensions' do
      ::ActionDispatch::Routing::RouteSet::Generator.prepend(
        Slugs::Extensions::ActionDispatch::Generator
      )
      ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper.prepend(
        Slugs::Extensions::ActionDispatch::OptimizedUrlHelper
      )
      ::ActiveRecord::Base.include(
        Slugs::Extensions::ActiveRecord::Base
      )
      ::ActiveRecord::Base.extend(
        Slugs::Extensions::ActiveRecord::Finders
      )
      ::ActiveRecord::Relation.include(
        Slugs::Extensions::ActiveRecord::Finders
      )
    end

    rake_tasks do
      load 'tasks/slugs.rake'
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slugs-4.0.0.2 lib/slugs/railtie.rb