aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request_event.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-08-26 09:48:01 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-08-26 09:53:51 +0100
commit0c321987194b3ef089e32f61cdac351d6b44e8c4 (patch)
tree13865e0a252e5131077f3f47be0d666290f7fafa /app/models/info_request_event.rb
parentf8745d1e5950d458eb2eca87f15b4f3b65ed42ae (diff)
Further work in progress on better search functionality
Diffstat (limited to 'app/models/info_request_event.rb')
-rw-r--r--app/models/info_request_event.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index fbf70332d..4003217b0 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -134,11 +134,19 @@ class InfoRequestEvent < ActiveRecord::Base
end
def latest_variety
- self.info_request.get_last_event.variety
+ for event in self.info_request.info_request_events.reverse
+ if !event.variety.nil? and !event.variety.empty?
+ return event.variety
+ end
+ end
end
def latest_status
- self.info_request.get_last_event.calculated_state
+ for event in self.info_request.info_request_events.reverse
+ if !event.calculated_state.nil? and !event.calculated_state.empty?
+ return event.calculated_state
+ end
+ end
end
def waiting_classification