diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-11-29 12:12:40 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-11-29 12:12:40 +0000 |
commit | a3ba1967b2ac1789f048aec3250fb6f95b6f6456 (patch) | |
tree | beea77aacab698b687669c2236be76913474c9a9 | |
parent | 4160a6d47ed4b5a1de1974a0e1dd08a333b3564e (diff) |
Use Rails.env as a more reliable way of determining environment - it may not have come from ENV.
-rw-r--r-- | app/models/foi_attachment.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index a40898aef..7c4c3226f 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -38,7 +38,7 @@ class FoiAttachment < ActiveRecord::Base BODY_MAX_DELAY = 5 def directory - rails_env = ENV['RAILS_ENV'] + rails_env = Rails.env if rails_env.nil? || rails_env.empty? raise "$RAILS_ENV is not set" end @@ -323,7 +323,7 @@ class FoiAttachment < ActiveRecord::Base elsif self.content_type == 'application/rtf' html = AlaveteliExternalCommand.run("unrtf", "--html", tempfile.path, :timeout => 120) end - + if html.nil? if self.has_google_docs_viewer? html = '' # force error and using Google docs viewer |