[#120] add check before removing '/' from the end of the APP_CONFIG

This commit is contained in:
Alexander Machehin 2013-05-07 17:18:24 +06:00
parent d3e144239c
commit 28752f6f6a
1 changed files with 1 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# -*- encoding : utf-8 -*-
APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env]
# Remove '/' from the end of url
APP_CONFIG.keys.select {|key| key =~ /_url\Z/}.each {|key| APP_CONFIG[key] = APP_CONFIG[key].chomp('/')}
APP_CONFIG.keys.select {|key| key =~ /_url\Z/}.each {|key| APP_CONFIG[key] = APP_CONFIG[key].chomp('/') if APP_CONFIG[key].respond_to?(:chomp)}