diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-11-12 15:14:27 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-11-12 15:14:27 +0000 |
commit | 92d5d2bcdaca56a6508504a8aa86e56f3630d301 (patch) | |
tree | eda89d211683af598088e91790176d3289a62e4a | |
parent | 8dbd22fdf300121eaa129502651dd256c7e5c75a (diff) |
Use calls to write_attribute
Under the Rails hood, using the setters for attributes now involves
calling the getters too, (for a will_change? check), so these calls
became circular - use write_attribute instead.
-rw-r--r-- | app/models/incoming_message.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 8b2aa87e7..bcf0b6ec9 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -129,15 +129,15 @@ class IncomingMessage < ActiveRecord::Base if (!force.nil? || self.last_parsed.nil?) ActiveRecord::Base.transaction do self.extract_attachments! - self.sent_at = self.mail.date || self.created_at - self.subject = self.mail.subject - self.mail_from = MailHandler.get_from_name(self.mail) + write_attribute(:sent_at, self.mail.date || self.created_at) + write_attribute(:subject, self.mail.subject) + write_attribute(:mail_from, MailHandler.get_from_name(self.mail)) if self.from_email self.mail_from_domain = PublicBody.extract_domain_from_email(self.from_email) else self.mail_from_domain = "" end - self.valid_to_reply_to = self._calculate_valid_to_reply_to + write_attribute(:valid_to_reply_to, self._calculate_valid_to_reply_to) self.last_parsed = Time.now self.foi_attachments reload=true self.save! |