aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/railties.rb
blob: c1d2de571fbbd319382260b40bbb777c6ccb9578 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'rails/engine/railties'

module Rails
  class Application < Engine
    class Railties < Rails::Engine::Railties
      def all(&block)
        @all ||= railties + engines + super
        @all.each(&block) if block
        @all
      end

      def railties
        @railties ||= ::Rails::Railtie.subclasses.map(&:instance)
      end

      def engines
        @engines ||= ::Rails::Engine.subclasses.map(&:instance)
      end
    end
  end
end