diff --git a/app/models/problem.rb b/app/models/problem.rb index 0049926..5a8ed32 100644 --- a/app/models/problem.rb +++ b/app/models/problem.rb @@ -42,6 +42,7 @@ class Problem validates_presence_of :environment before_create :cache_app_attributes + before_save :truncate_message scope :resolved, ->{ where(:resolved => true) } scope :unresolved, ->{ where(:resolved => false) } @@ -140,6 +141,10 @@ class Problem end end + def truncate_message + self.message = self.message[0, 1000] if self.message + end + def remove_cached_notice_attributes(notice) update_attributes!( :messages => attribute_count_descrease(:messages, notice.message), -- libgit2 0.21.2