| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
| |
They're duplicated on /admin/summary and a bit slow [1].
[1] https://wiki.postgresql.org/wiki/Slow_Counting
|
|
|
|
|
|
| |
user system total real
old 1.070000 0.280000 1.350000 ( 1.657773)
new 0.560000 0.120000 0.680000 ( 0.743485)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes the following bullet warning:
N+1 Query detected
PublicBody => [:translations]
Add to your finder: :includes => [:translations]
N+1 Query method call stack
/home/vagrant/alaveteli/app/helpers/link_to_helper.rb:70:in
`public_body_url'
/home/vagrant/alaveteli/app/helpers/link_to_helper.rb:74:in
`public_body_path'
/home/vagrant/alaveteli/app/helpers/admin_helper.rb:28:in
`public_body_both_links'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:148:in
`_app_views_admin_general_index_html_erb__1495531968_70090875267640'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:145:in
`each'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:145:in
`_app_views_admin_general_index_html_erb__1495531968_70090875267640'
/home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in
`record_memory'
/home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in
`call'
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes the following bullet warning:
N+1 Query detected
IncomingMessage => [:raw_email]
Add to your finder: :includes => [:raw_email]
N+1 Query method call stack
/home/vagrant/alaveteli/app/models/incoming_message.rb:115:in
`parse_raw_email!'
/home/vagrant/alaveteli/app/models/incoming_message.rb:150:in `sent_at'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:54:in
`_app_views_admin_general_index_html_erb___48164640_70115534664600'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:42:in
`_app_views_admin_general_index_html_erb___48164640_70115534664600'
/home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in
`record_memory'
/home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in
`call'
Improved view rendering times:
Before: Completed 200 OK in 2813.9ms (Views: 1697.3ms | ActiveRecord: 9.5ms)
Completed 200 OK in 2548.6ms (Views: 1838.2ms | ActiveRecord: 8.2ms)
After: Completed 200 OK in 2185.9ms (Views: 276.0ms | ActiveRecord: 7.5ms)
Completed 200 OK in 2216.3ms (Views: 100.3ms | ActiveRecord: 7.6ms)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes the following bullet warnings:
N+1 Query detected
PublicBodyChangeRequest => [:public_body]
Add to your finder: :includes => [:public_body]
N+1 Query method call stack
/home/vagrant/alaveteli/app/models/public_body_change_request.rb:65:in
`get_public_body_name'
/home/vagrant/alaveteli/app/views/admin_general/_change_request_summary.html
.erb:8:in
`_app_views_admin_general__change_request_summary_html_erb__490351475_701155
42681500'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:225:in
`_app_views_admin_general_index_html_erb___48164640_70115537288900'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:224:in
`_app_views_admin_general_index_html_erb___48164640_70115537288900'
/home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in
`record_memory'
/home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in
`call'
N+1 Query detected
PublicBodyChangeRequest => [:user]
Add to your finder: :includes => [:user]
N+1 Query method call stack
/home/vagrant/alaveteli/app/models/public_body_change_request.rb:57:in
`get_user_name'
/home/vagrant/alaveteli/app/views/admin_general/_change_request_summary.html
.erb:46:in
`_app_views_admin_general__change_request_summary_html_erb__490351475_701155
42681500'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:225:in
`_app_views_admin_general_index_html_erb___48164640_70115537288900'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:224:in
`_app_views_admin_general_index_html_erb___48164640_70115537288900'
/home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in
`record_memory'
/home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in
`call'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes the following Bullet warnings:
N+1 Query detected
PublicBodyChangeRequest => [:public_body]
Add to your finder: :includes => [:public_body]
N+1 Query method call stack
/home/vagrant/alaveteli/app/models/public_body_change_request.rb:65:in
`get_public_body_name'
/home/vagrant/alaveteli/app/views/admin_general/_change_request_summary.html
.erb:8:in
`_app_views_admin_general__change_request_summary_html_erb__490351475_701155
42681500'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:191:in
`_app_views_admin_general_index_html_erb___48164640_70115537288900'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:190:in
`_app_views_admin_general_index_html_erb___48164640_70115537288900'
/home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in
`record_memory'
/home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in
`call'
N+1 Query detected
PublicBodyChangeRequest => [:user]
Add to your finder: :includes => [:user]
N+1 Query method call stack
/home/vagrant/alaveteli/app/models/public_body_change_request.rb:57:in
`get_user_name'
/home/vagrant/alaveteli/app/views/admin_general/_change_request_summary.html
.erb:46:in
`_app_views_admin_general__change_request_summary_html_erb__490351475_701155
42681500'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:191:in
`_app_views_admin_general_index_html_erb___48164640_70115537288900'
/home/vagrant/alaveteli/app/views/admin_general/index.html.erb:190:in
`_app_views_admin_general_index_html_erb___48164640_70115537288900'
/home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in
`record_memory'
/home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in
`call'
|
| |
|
| |
|
|
|
|
|
|
| |
user system total real
old 0.050000 0.020000 0.070000 ( 0.088856)
new 0.020000 0.000000 0.020000 ( 0.018556)
|
|\ |
|
| |
| |
| |
| |
| |
| | |
This was added because TMail calls String#is_binary_data? which
does not exist in Ruby 1.9.2 onwards. We don't use TMail anymore
so this is no longer needed.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a workaround for an issue where YAML in ruby 1.8 tags UTF-8
heavy strings as binary, resulting in them being retrieved under 1.9
as ASCII-8BIT which can't be concatenated with UTF-8.
Described as "Deep deep YAML oddness" in
https://www.zendesk.com/blog/upgrade-the-road-to-1-9/.
|
| |/
| |
| |
| | |
Items cached in 1.8 can't safely be retrieved in 1.9
|
|\ \ |
|
|/ /
| |
| |
| | |
Help to kill N+1 queries and unused eager loading
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Remove explicit returns
Remove self
Ternary for short conditional
Moved #site_administration? to be nearer similar methods
|
| | |
| | |
| | |
| | |
| | | |
Doesn't need to try to set the default law_used once it's persisted,
so we save a query each time we find an InfoRequest
|
| | | |
|
|/ / |
|
|\ \
| |/
|/| |
|
| | |
|
| | |
|
|\ \ |
|
|/ / |
|
|\ \ |
|
|/ /
| |
| |
| |
| | |
This is so that they can access mail log files. adm group members
have access to read log files in /var/log
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Use of each rather than for, case statement for multi-clause if,
variable interpolation rather than concatenation. Also use inline
variables in the each for clarity.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Clearer, and more efficient.
|
| | |
| | |
| | |
| | | |
It's idiomatic, and you can assign the elements of the list inline.
|
| | |
| | |
| | |
| | | |
Exceptions are a slow way to do control flow, and this seems clearer.
|
|\ \ \
| | | |
| | | |
| | | | |
ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
|
| |\ \ \
| | | |/
| | |/| |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Bumping to .25 because I forgot before I merged hotfix 0.21.0.24;
treating this as a new hotfix.
|
| | |\ \ |
|
| |\ \ \ \
| | | |/ /
| | |/| | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If you run an Alaveteli in a region where we can’t show holiday
suggestions the holiday import page breaks. This commit rescues from
an unavailable region so that we display a friendly error message.
|
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | | |
Next commit adds a new spec; this before block was affecting the
behaviour of the new spec.
https://robots.thoughtbot.com/lets-not
|