aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2013-02-20 12:25:10 +1100
committerHenare Degan <henare.degan@gmail.com>2013-02-20 12:25:10 +1100
commit38d9af3c4561f54e67e7706ab065d3952e7469ca (patch)
tree068162ad5e72fd48aa5166c3ad9ac05eb8a104af
parent7f93d7f1d486f55f6ebe9da37150d16b1a4fa634 (diff)
Rails.env should never not be set, I think this is a relic of RAILS_ENV
-rw-r--r--app/models/foi_attachment.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb
index 723bc4abb..768e8d1d3 100644
--- a/app/models/foi_attachment.rb
+++ b/app/models/foi_attachment.rb
@@ -38,11 +38,7 @@ class FoiAttachment < ActiveRecord::Base
BODY_MAX_DELAY = 5
def directory
- rails_env = Rails.env
- if rails_env.nil? || rails_env.empty?
- raise "$RAILS_ENV is not set"
- end
- base_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../cache", "attachments_#{rails_env}"))
+ base_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../cache", "attachments_#{Rails.env}"))
return File.join(base_dir, self.hexdigest[0..2])
end