Sha256: f80ad939b1dabdb2703c89159d88b3c5cf12a99d84d74139e36d31b47f4cd869
Contents?: true
Size: 763 Bytes
Versions: 62
Compression:
Stored size: 763 Bytes
Contents
module Rails class Application class RoutesReloader # HACK: Adds a rescue to the method that eager loads routes. This rescue # looks a the specific error the occurs when eager loading in development, # and forces the routes to reload again, clearing out load paths and # resetting everything -- essentially like restarting the application. # This allows us to avoid a constant need to stop and restart the server. # Only included in development environments. # def execute ret = updater.execute route_sets.each(&:eager_load!) if eager_load ret rescue ArgumentError => e raise e unless e.message == "unknown firstpos: NilClass" reload! end end end end
Version data entries
62 entries across 62 versions & 1 rubygems