diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-10-21 17:03:26 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-10-29 13:01:12 +0000 |
commit | 63752569c170334cfa81170c5b8b18cde293c77b (patch) | |
tree | 8cd517e22e466a3330d478fbbec0754dd9b0349a | |
parent | fd43a9689d734f6c733250e095270c7077dede04 (diff) |
Extract RawEmail inline calls to private methods
One less thing for #directory and #filepath to do
-rw-r--r-- | app/models/raw_email.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/models/raw_email.rb b/app/models/raw_email.rb index 4c90a20b6..3b466cb81 100644 --- a/app/models/raw_email.rb +++ b/app/models/raw_email.rb @@ -17,7 +17,6 @@ class RawEmail < ActiveRecord::Base has_one :incoming_message def directory - request_id = incoming_message.info_request.id.to_s if request_id.empty? raise "Failed to find the id number of the associated request: has it been saved?" end @@ -31,7 +30,6 @@ class RawEmail < ActiveRecord::Base end def filepath - incoming_message_id = incoming_message.id.to_s if incoming_message_id.empty? raise "Failed to find the id number of the associated incoming message: has it been saved?" end @@ -52,6 +50,13 @@ class RawEmail < ActiveRecord::Base File.delete(filepath) end -end + private + def request_id + incoming_message.info_request.id.to_s + end + def incoming_message_id + incoming_message.id.to_s + end +end |