lib/slugs/railtie.rb in slugs-2.0.1 vs lib/slugs/railtie.rb in slugs-4.0.0.0
- old
+ new
@@ -1,16 +1,22 @@
module Slugs
class Railtie < Rails::Railtie
- initializer 'slugs' do
- ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper.prepend(
- Slugs::Extensions::ActionDispatch::OptimizedUrlHelper
- )
+ 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
end
end