aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-24 14:45:02 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-24 14:45:02 +0000
commit4df04823729df29b5c7383cdd13c2b76daa48121 (patch)
tree8318eef9e30149ec50c5d5352cf3fe48f654c033
parent8b64d831a45e9856e94673917462a087c5a2f310 (diff)
Remove references to removed database columns
Remove the references to raw_emails.data_text and data_binary, which have not existed since the summer.
-rw-r--r--app/models/raw_email.rb26
1 files changed, 2 insertions, 24 deletions
diff --git a/app/models/raw_email.rb b/app/models/raw_email.rb
index 6e073aa27..3e12a6feb 100644
--- a/app/models/raw_email.rb
+++ b/app/models/raw_email.rb
@@ -27,7 +27,7 @@ class RawEmail < ActiveRecord::Base
def directory
request_id = self.incoming_message.info_request.id.to_s
if ENV["RAILS_ENV"] == "test"
- return 'files/raw_email_test'
+ return File.join(RAILS_ROOT, 'files/raw_email_test')
else
return File.join(MySociety::Config.get('RAW_EMAILS_LOCATION',
'files/raw_emails'),
@@ -49,35 +49,13 @@ class RawEmail < ActiveRecord::Base
end
def data
- if !File.exists?(self.filepath)
- dbdata
- else
- File.open(self.filepath, "rb" ).read
- end
+ File.open(self.filepath, "rb").read
end
def destroy_file_representation!
File.delete(self.filepath)
end
- def dbdata=(d)
- write_attribute(:data_binary, d)
- end
-
- def dbdata
- d = read_attribute(:data_binary)
- if !d.nil?
- return d
- end
-
- d = read_attribute(:data_text)
- if !d.nil?
- return d
- end
-
- raise "internal error, double nil value in RawEmail"
- end
-
end