Sha256: de4efb0b2bed4d59e1495def20afc5ae69b81923c279e276253d834cebab0852

Contents?: true

Size: 562 Bytes

Versions: 21

Compression:

Stored size: 562 Bytes

Contents

module Avo
  class DynamicRouter
    def self.routes
      Avo::Engine.routes.draw do
        scope "resources", as: "resources" do
          Avo::App.eager_load(:resources) unless Rails.application.config.eager_load

          BaseResource.descendants
            .select do |resource|
              resource != :BaseResource
            end
            .select do |resource|
              resource.is_a? Class
            end
            .map do |resource|
              resources resource.new.route_key
            end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
avo-2.26.2.pre.pr1579 lib/avo/dynamic_router.rb
avo-2.25.1.pre.1.pr1579 lib/avo/dynamic_router.rb
avo-2.26.0 lib/avo/dynamic_router.rb
avo-2.25.0 lib/avo/dynamic_router.rb
avo-2.24.1 lib/avo/dynamic_router.rb
avo-2.24.0 lib/avo/dynamic_router.rb
avo-2.23.3.pre.1.pr1529 lib/avo/dynamic_router.rb
avo-2.23.2 lib/avo/dynamic_router.rb
avo-2.23.1 lib/avo/dynamic_router.rb
avo-2.23.0 lib/avo/dynamic_router.rb
avo-2.22.0 lib/avo/dynamic_router.rb
avo-2.21.3.pre.pr1489 lib/avo/dynamic_router.rb
avo-2.21.2.pre.pr1486 lib/avo/dynamic_router.rb
avo-2.21.1.pre.pr1484 lib/avo/dynamic_router.rb
avo-2.21.0 lib/avo/dynamic_router.rb
avo-2.21.1.pre.pr1476 lib/avo/dynamic_router.rb
avo-2.21.1.pre.issue1450 lib/avo/dynamic_router.rb
avo-2.21.1.pre.issue1444 lib/avo/dynamic_router.rb
avo-2.20.0 lib/avo/dynamic_router.rb
avo-2.19.0 lib/avo/dynamic_router.rb