diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-05-05 18:16:21 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-05-07 15:53:14 +0100 |
commit | 44be6f9014728c83adbc582baaba29c231365643 (patch) | |
tree | 8d1ddb1016509630a87d3ea9d742d5bae330bfea /spec/controllers/widgets_controller_spec.rb | |
parent | 8068b389a0c3118eeb13148021bd064b9226a9e3 (diff) |
Use existing attribute
`last_event_time` is set as a result of calling
`InfoRequest.find_in_state`. This commit adds an explicit accessor that
converts it to a `DateTime` and uses it in the view, preventing an extra
query for each `InfoRequest` in the result set.
Before:
Completed 200 OK in 14908.9ms (Views: 14625.3ms | ActiveRecord: 69.8ms)
After:
Completed 200 OK in 2481.0ms (Views: 2437.1ms | ActiveRecord: 5.2ms)
Diffstat (limited to 'spec/controllers/widgets_controller_spec.rb')
0 files changed, 0 insertions, 0 deletions