diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-08-10 07:34:13 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-08-10 07:34:13 +0200 |
commit | a0fa45c0e67761d53fb94b29ac7d0a0f6378904a (patch) | |
tree | 78a0b1dbffc1c98b660712e8986ed5a851162f31 /railties/lib/rails | |
parent | 67b07f809b4621aefe1956c2fa23646fee230ccc (diff) | |
parent | f50e90a1aeaee0e1e907e51cd2a9349d0af2c087 (diff) | |
download | rails-a0fa45c0e67761d53fb94b29ac7d0a0f6378904a.tar.gz rails-a0fa45c0e67761d53fb94b29ac7d0a0f6378904a.tar.bz2 rails-a0fa45c0e67761d53fb94b29ac7d0a0f6378904a.zip |
Merge pull request #21124 from kirs/feature/reload-i18n
Reload I18n.load_path in development
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/engine.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/paths.rb | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 07d0c270b7..e90d41cbec 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -587,7 +587,7 @@ module Rails # I18n load paths are a special case since the ones added # later have higher priority. initializer :add_locales do - config.i18n.railties_load_path.concat(paths["config/locales"].existent) + config.i18n.railties_load_path << paths["config/locales"] end initializer :add_view_paths do diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index ebcaaaba46..8a7aa6f50a 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -123,6 +123,11 @@ module Rails options[:load_path] ? load_path! : skip_load_path! end + # :nodoc: + def absolute_current + File.expand_path(@current, @root.path) + end + def children keys = @root.keys.find_all { |k| k.start_with?(@current) && k != @current @@ -175,6 +180,11 @@ module Rails @paths end + # :nodoc: + def extensions + $1.split(',') if @glob =~ /\{([\S]+)\}/ + end + # Expands all paths against the root and return all unique values. def expanded raise "You need to set a path root" unless @root.path |