]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/amf_controller.rb
Use before_validation with :on rather than before_validation_on_xxx
[rails.git] / app / controllers / amf_controller.rb
index 078823cbb3dc72ec7826461954ce8b1cfd1a0793..534e41a8092f6a52f95593b347b436c9af2f158e 100644 (file)
@@ -265,14 +265,14 @@ class AmfController < ApplicationController
     loaded_lang = 'en'
 
     # Load English defaults
-    en = YAML::load(File.open("#{RAILS_ROOT}/config/potlatch/locales/en.yml"))["en"]
+    en = YAML::load(File.open("#{Rails.root}/config/potlatch/locales/en.yml"))["en"]
 
     if lang == 'en'
       return [loaded_lang, en]
     else
       # Use English as a fallback
       begin
-        other = YAML::load(File.open("#{RAILS_ROOT}/config/potlatch/locales/#{lang}.yml"))[lang]
+        other = YAML::load(File.open("#{Rails.root}/config/potlatch/locales/#{lang}.yml"))[lang]
         loaded_lang = lang
       rescue
         other = en
@@ -916,7 +916,7 @@ class AmfController < ApplicationController
   end
 
   def getlocales
-    Dir.glob("#{RAILS_ROOT}/config/potlatch/locales/*").collect { |f| File.basename(f, ".yml") }
+    Dir.glob("#{Rails.root}/config/potlatch/locales/*").collect { |f| File.basename(f, ".yml") }
   end
   
   ##