YaleSTC / shifts

Application to easily track shifts, reports, and payforms for employees.
MIT License
23 stars 18 forks source link

Editing 'templates for STC' under 'Admin options' breaks #354

Closed jiggoha closed 10 years ago

jiggoha commented 10 years ago

When an admin user edits the template and inputs the roles that the template should be enabled for and clicks 'save', there is an ActiveRecord::Relation 'NoMethodError'.

Started GET "/templates/1" for 127.0.0.1 at 2014-09-02 10:04:29 -0400
Processing by TemplatesController#show as HTML
  Parameters: {"id"=>"1"}
  AppConfig Load (0.3ms)  SELECT `app_configs`.* FROM `app_configs` 
  User Load (1.5ms)  SELECT `users`.* FROM `users` 
  User Load (0.5ms)  SELECT `users`.* FROM `users` WHERE `users`.`login` = 'jh938' LIMIT 1
Existing local CAS session detected for "jh938". Previous ticket "ST-2285877-s9Pfayv2gt3lEtpeuQrj-cas" will be re-used.
  CACHE (0.0ms)  SELECT `users`.* FROM `users` 
  Department Load (0.3ms)  SELECT `departments`.* FROM `departments` WHERE (1) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE `users`.`login` = 'jh938' LIMIT 1
  Role Load (0.4ms)  SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON `roles`.`id` = `roles_users`.`role_id` WHERE `roles_users`.`user_id` = 1
  Permission Load (0.3ms)  SELECT `permissions`.* FROM `permissions` INNER JOIN `permissions_roles` ON `permissions`.`id` = `permissions_roles`.`permission_id` WHERE `permissions_roles`.`role_id` = 1
  Permission Load (0.2ms)  SELECT `permissions`.* FROM `permissions` WHERE `permissions`.`id` = 1 LIMIT 1
  DepartmentsUser Load (0.2ms)  SELECT `departments_users`.* FROM `departments_users` WHERE `departments_users`.`user_id` = 1 AND `departments_users`.`department_id` = 1 AND `departments_users`.`active` = 1 LIMIT 1
  Template Load (0.2ms)  SELECT `templates`.* FROM `templates` WHERE `templates`.`id` = 1 LIMIT 1
  Role Load (0.3ms)  SELECT `roles`.* FROM `roles` INNER JOIN `roles_templates` ON `roles`.`id` = `roles_templates`.`role_id` WHERE `roles_templates`.`template_id` = 1
  TemplateTimeSlot Load (0.2ms)  SELECT `template_time_slots`.* FROM `template_time_slots` WHERE `template_time_slots`.`template_id` = 1
  Location Load (0.2ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  Location Load (0.2ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 3 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 5 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 4 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 1 LIMIT 1
  CACHE (0.0ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`id` = 2 LIMIT 1
  RequestedShift Load (0.3ms)  SELECT `requested_shifts`.* FROM `requested_shifts` WHERE `requested_shifts`.`template_id` = 1 AND `requested_shifts`.`day` = 6 AND (requested_shifts.assigned_start < '2014-09-02 13:54:10')
  Rendered templates/schedule/_event_group.html.erb (6.4ms)
  Rendered templates/schedule/_day.html.erb (18.5ms)
  Rendered templates/show.html.erb within layouts/application (45.8ms)
Completed 500 Internal Server Error in 84.7ms

NoMethodError - undefined method `at_location' for []:ActiveRecord::Relation:
  activerecord (3.2.19) lib/active_record/relation/delegation.rb:45:in `method_missing'
  app/views/templates/schedule/_event_group.html.erb:2:in `_app_views_templates_schedule__event_group_html_erb___3119245964401451655_70288783484740'
  actionpack (3.2.19) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.19) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.19) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:351:in `block in collection_with_template'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:348:in `collection_with_template'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:250:in `render_collection'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:234:in `block in render'
  actionpack (3.2.19) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.19) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:233:in `render'
  actionpack (3.2.19) lib/action_view/renderer/renderer.rb:41:in `render_partial'
  actionpack (3.2.19) lib/action_view/renderer/renderer.rb:15:in `render'
  actionpack (3.2.19) lib/action_view/helpers/rendering_helper.rb:24:in `render'
  app/views/templates/schedule/_day.html.erb:10:in `_app_views_templates_schedule__day_html_erb___3779212457684276162_70288811230300'
  actionpack (3.2.19) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.19) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.19) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:351:in `block in collection_with_template'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:348:in `collection_with_template'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:250:in `render_collection'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:234:in `block in render'
  actionpack (3.2.19) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.19) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (3.2.19) lib/action_view/renderer/partial_renderer.rb:233:in `render'
  actionpack (3.2.19) lib/action_view/renderer/renderer.rb:41:in `render_partial'
  actionpack (3.2.19) lib/action_view/renderer/renderer.rb:15:in `render'
  actionpack (3.2.19) lib/action_view/helpers/rendering_helper.rb:24:in `render'
  app/views/templates/show.html.erb:52:in `_app_views_templates_show_html_erb___2563236994010522624_70288836807520'
  actionpack (3.2.19) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.19) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.19) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
  actionpack (3.2.19) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.19) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:46:in `block in render_template'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
  actionpack (3.2.19) lib/action_view/renderer/template_renderer.rb:18:in `render'
  actionpack (3.2.19) lib/action_view/renderer/renderer.rb:36:in `render_template'
  actionpack (3.2.19) lib/action_view/renderer/renderer.rb:17:in `render'
  actionpack (3.2.19) lib/abstract_controller/rendering.rb:110:in `_render_template'
  actionpack (3.2.19) lib/action_controller/metal/streaming.rb:225:in `_render_template'
  actionpack (3.2.19) lib/abstract_controller/rendering.rb:103:in `render_to_body'
  actionpack (3.2.19) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
  actionpack (3.2.19) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
  actionpack (3.2.19) lib/abstract_controller/rendering.rb:88:in `render'
  actionpack (3.2.19) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
  activesupport (3.2.19) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
  /Users/jiggoha/.rbenv/versions/2.1.2/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
  activesupport (3.2.19) lib/active_support/core_ext/benchmark.rb:5:in `ms'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
  activerecord (3.2.19) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:39:in `render'
  actionpack (3.2.19) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
  actionpack (3.2.19) lib/action_controller/metal/mime_responds.rb:196:in `respond_to'
  app/controllers/templates_controller.rb:16:in `show'
  actionpack (3.2.19) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.19) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.19) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.19) lib/active_support/callbacks.rb:535:in `_run__1662685079747139068__process_action__3249583211035518062__callbacks'
  activesupport (3.2.19) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.19) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.19) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.19) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.19) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.19) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.19) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.19) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.19) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.19) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.19) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.19) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:608:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.19) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.19) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.19) lib/active_support/callbacks.rb:405:in `_run__2896694608201705831__call__3999281703985897076__callbacks'
  activesupport (3.2.19) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.19) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.19) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.19) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:56:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.19) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.19) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.19) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.19) lib/rails/rack/logger.rb:16:in `call'
  lib/custom_logger.rb:15:in `call'
  request_store (1.1.0) lib/request_store/middleware.rb:8:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.19) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in `call'
  railties (3.2.19) lib/rails/engine.rb:484:in `call'
  railties (3.2.19) lib/rails/application.rb:231:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.19) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
  /Users/jiggoha/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  /Users/jiggoha/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  /Users/jiggoha/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

Started POST "/__better_errors/70288854091060/variables" for 127.0.0.1 at 2014-09-02 10:04:30 -0400
  RequestedShift Load (0.7ms)  SELECT `requested_shifts`.* FROM `requested_shifts` WHERE `requested_shifts`.`template_id` = 1
njlxyaoxinwei commented 10 years ago

This is because the at_location scope of the requested_shift model is broken