ActiveRecord::StatementInvalid
in ConditionsController#matches
DatabaseError: ERROR VERROR C42703 Mcolumn "distance" does not exist P790 Fparse_relation.c L3337 RerrorMissingColumn:
SELECT DISTINCT ON (distance, catname(items.name), conditions.id) conditions.id,
l.id AS latest_load_id
FROM conditions, items, shelters
LEFT OUTER JOIN (SELECT * FROM loads WHERE id IN
(SELECT max(id) FROM loads WHERE loads.status = 0 AND loads.source_id = 781 GROUP BY loads.destination_id)) l
ON l.destination_id = shelters.id
WHERE (shelters.facility_type != 11) AND shelters.id = conditions.shelter_id
AND shelters.id != 781
AND conditions.item_id = items.id
AND conditions.type = 'Need'
AND (load_id IS NULL)
AND conditions.item_id IN
(SELECT item_id FROM conditions WHERE shelter_id = 781 AND type = 'Surplus' AND (load_id IS NULL))
ORDER BY distance, catname(items.name)
;
RAILS_ROOT: /home/ubuntu/relief/reliefdb/script/../config/..
Application Trace |
Framework Trace |
Full Trace
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/postgresql_adapter.rb:152:in `execute'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/postgresql_adapter.rb:433:in `select'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'
/home/ubuntu/relief/reliefdb/app/models/shelter.rb:190:in `matches'
/home/ubuntu/relief/reliefdb/app/models/shelter.rb:164:in `avail_matches'
/home/ubuntu/relief/reliefdb/app/controllers/conditions_controller.rb:336:in `matches'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/postgresql_adapter.rb:152:in `execute'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/postgresql_adapter.rb:433:in `select'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:1101:in `send'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:1101:in `perform_action_without_filters'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/filters.rb:696:in `call_filters'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/filters.rb:688:in `perform_action_without_benchmark'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/rescue.rb:83:in `perform_action'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:435:in `send'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:435:in `process_without_filters'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/filters.rb:684:in `process_without_session_management_support'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/session_management.rb:114:in `process'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:334:in `process'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/dispatcher.rb:41:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/webrick_server.rb:113:in `handle_dispatch'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/webrick_server.rb:79:in `service'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/webrick_server.rb:63:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/commands/servers/webrick.rb:59
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/commands/server.rb:39
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/ubuntu/relief/reliefdb/script/server:3
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/postgresql_adapter.rb:152:in `execute'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/postgresql_adapter.rb:433:in `select'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'
/home/ubuntu/relief/reliefdb/app/models/shelter.rb:190:in `matches'
/home/ubuntu/relief/reliefdb/app/models/shelter.rb:164:in `avail_matches'
/home/ubuntu/relief/reliefdb/app/controllers/conditions_controller.rb:336:in `matches'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:1101:in `send'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:1101:in `perform_action_without_filters'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/filters.rb:696:in `call_filters'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/filters.rb:688:in `perform_action_without_benchmark'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/rescue.rb:83:in `perform_action'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:435:in `send'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:435:in `process_without_filters'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/filters.rb:684:in `process_without_session_management_support'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/session_management.rb:114:in `process'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-1.13.6/lib/action_controller/base.rb:334:in `process'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/dispatcher.rb:41:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/webrick_server.rb:113:in `handle_dispatch'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/webrick_server.rb:79:in `service'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/webrick_server.rb:63:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/commands/servers/webrick.rb:59
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p371/gems/rails-1.2.6/lib/commands/server.rb:39
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/ubuntu/relief/reliefdb/script/server:3
Request
Parameters: {"show_only_my"=>"0",
"show_regional"=>"1",
"avail"=>"1",
"id"=>"781",
"show_urgent"=>"0",
"show_closed"=>"1",
"sort_req_id"=>"1",
"sort"=>"Distance",
"factype"=>"All,
Except Businesses",
"show_servaff"=>"1"}
Show session dump
---
shelter_list_state:
shelter_list_parish:
shelter_list_region:
sort_req_id: 1
flash: !map:ActionController::Flash::FlashHash {}
match_sort:
- Distance
Response
Headers: {"Cache-Control"=>"no-cache",
"cookie"=>[]}