From e5dd06bb90b28b14b9a476d999d22ca345dabf07 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Thu, 11 Oct 2012 10:09:21 +1100 Subject: Rename models and tables exim -> mail_server --- app/models/info_request.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 85168e6d4..d8c84fa9e 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -47,7 +47,7 @@ class InfoRequest < ActiveRecord::Base has_many :track_things, :order => 'created_at desc' has_many :comments, :order => 'created_at' has_many :censor_rules, :order => 'created_at desc' - has_many :exim_logs, :order => 'exim_log_done_id' + has_many :mail_server_logs, :order => 'mail_server_log_done_id' has_tag_string @@ -884,8 +884,8 @@ public info_request_event.track_things_sent_emails.each { |a| a.destroy } info_request_event.destroy end - self.exim_logs.each do |exim_log| - exim_log.destroy + self.mail_server_logs.each do |mail_server_log| + mail_server_log.destroy end self.outgoing_messages.each { |a| a.destroy } self.incoming_messages.each { |a| a.destroy } -- cgit v1.2.3 From d21d9b9dd10a1379ecb686e339992d7790e4bd61 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Wed, 17 Oct 2012 14:40:57 +1100 Subject: In number of requests shown on home page only include requests with normal prominence --- app/models/info_request.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index d8c84fa9e..74a67b9d9 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -51,6 +51,8 @@ class InfoRequest < ActiveRecord::Base has_tag_string + named_scope :visible, :conditions => {:prominence => "normal"} + # user described state (also update in info_request_event, admin_request/edit.rhtml) validate :must_be_valid_state -- cgit v1.2.3 From 0e69654a5cd91ac6ef89bb32148d2adb031bd4a2 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 23 Oct 2012 17:50:19 +0100 Subject: Add an option to calls to calculate_status and display_status to specify that the method can return a value cached on the object by a previous call. --- app/models/info_request.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 74a67b9d9..47424e573 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -584,12 +584,11 @@ public # waiting_classification # waiting_response_overdue # waiting_response_very_overdue - def calculate_status - if @@custom_states_loaded - return self.theme_calculate_status - else - self.base_calculate_status + def calculate_status(cached_value_ok=false) + if cached_value_ok && @cached_calculated_status + return @cached_calculated_status end + @cached_calculated_status = @@custom_states_loaded ? self.theme_calculate_status : self.base_calculate_status end def base_calculate_status @@ -871,8 +870,8 @@ public end end - def display_status - InfoRequest.get_status_description(self.calculate_status) + def display_status(cached_value_ok=false) + InfoRequest.get_status_description(self.calculate_status(cached_value_ok)) end # Completely delete this request and all objects depending on it -- cgit v1.2.3 From bec84a144eda607404c2db676b61a486610e51f7 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 25 Oct 2012 18:00:38 +0100 Subject: Handle the default blank string passed by Configuration module --- app/models/info_request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 47424e573..89893a396 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1139,7 +1139,7 @@ public before_save :purge_in_cache def purge_in_cache - if !Configuration::varnish_host.nil? && !self.id.nil? + if !Configuration::varnish_host.blank? && !self.id.nil? # we only do this for existing info_requests (new ones have a nil id) path = url_for(:controller => 'request', :action => 'show', :url_title => self.url_title, :only_path => true, :locale => :none) req = PurgeRequest.find_by_url(path) -- cgit v1.2.3