2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

ES6: Patch up a few issues with the admin controllers conversion

This commit is contained in:
Robin Ward 2014-07-25 13:02:46 -04:00
parent e242368266
commit 15a51c6316
15 changed files with 37 additions and 51 deletions

View file

@ -70,9 +70,9 @@ module Tilt
# For backwards compatibility with plugins, for now export the Global format too.
# We should eventually have an upgrade system for plugins to use ES6 or some other
# resolve based API.
if ENV['DISCOURSE_NO_CONSTANTS'].nil? && scope.logical_path =~ /discourse\/(controllers|components|views|routes)\/(.*)/
type = Regexp.last_match[1]
file_name = Regexp.last_match[2].gsub(/[\-\/]/, '_')
if ENV['DISCOURSE_NO_CONSTANTS'].nil? && scope.logical_path =~ /(discourse|admin)\/(controllers|components|views|routes)\/(.*)/
type = Regexp.last_match[2]
file_name = Regexp.last_match[3].gsub(/[\-\/]/, '_')
class_name = file_name.classify
# Rails removes pluralization when calling classify