Sha256: 28992889eff760f3428ebed717fc46414a627a58743cbbf4ce54d9b6879d3cc6

Contents?: true

Size: 442 Bytes

Versions: 3

Compression:

Stored size: 442 Bytes

Contents

# frozen_string_literal: true

require "singleton"
Kernel.require "rails/railtie"

module SiteMaps
  class Railtie < ::Rails::Railtie
    initializer "site_maps.named_routes" do
      named_route = Class.new do
        include Singleton
        include ::Rails.application.routes.url_helpers
      end
      SiteMaps::Adapters::Adapter.prepend(Module.new do
        define_method(:route) { named_route.instance }
      end)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
site_maps-0.0.1.beta3 lib/site_maps/railtie.rb
site_maps-0.0.1.beta2 lib/site_maps/railtie.rb
site_maps-0.0.1.beta1 lib/site_maps/railtie.rb