aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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