This has changed with Rails 4.1. The accepted answer is deprecated and a new way to get installed applications for Rails now:
::Rails::Engine.subclasses.map(&:instance)
Here's a link to a commit on github that makes changes (and also shows how it was implemented after the initial deprecation ...)
If you need to use the previous solution from Rails 4.1:
module Rails class Engine class Railties def self.engines @engines ||= Rails::Engine.subclasses.map(&:instance) end end end end
Darren hicks
source share