{"action":"created","issue":{"url":"https://api.github.com/repos/zendesk/active_record_shards/issues/34","labels_url":"https://api.github.com/repos/zendesk/active_record_shards/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/zendesk/active_record_shards/issues/34/comments","events_url":"https://api.github.com/repos/zendesk/active_record_shards/issues/34/events","html_url":"https://github.com/zendesk/active_record_shards/pull/34","id":55020293,"number":34,"title":"Fix for v4.2.0 rails abort_if_pending_migrations task.","user":{"login":"zendesk-shender","id":8860832,"avatar_url":"https://avatars.githubusercontent.com/u/8860832?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk-shender","html_url":"https://github.com/zendesk-shender","followers_url":"https://api.github.com/users/zendesk-shender/followers","following_url":"https://api.github.com/users/zendesk-shender/following{/other_user}","gists_url":"https://api.github.com/users/zendesk-shender/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk-shender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk-shender/subscriptions","organizations_url":"https://api.github.com/users/zendesk-shender/orgs","repos_url":"https://api.github.com/users/zendesk-shender/repos","events_url":"https://api.github.com/users/zendesk-shender/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk-shender/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-21T13:46:43Z","updated_at":"2015-01-21T15:40:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zendesk/active_record_shards/pulls/34","html_url":"https://github.com/zendesk/active_record_shards/pull/34","diff_url":"https://github.com/zendesk/active_record_shards/pull/34.diff","patch_url":"https://github.com/zendesk/active_record_shards/pull/34.patch"},"body":"Describe your PR\r\nFix for the 'abort_if_pending_migrations' task for Rails 4.2.0 while using the zendesk_database_migrations gem. Without the fix, you get the below stack trace. The change matches a change in rails core: https://github.com/rails/rails/commit/fe70cde87cb1c03f1e2fd9e6ffa0877deda589af.\r\n\r\n```\r\n➜  zendesk_voyager git:(shender/multi_shard_tests) ✗ be rake -vt db:setup\r\n** Invoke db:setup (first_time)\r\n** Execute db:setup\r\n** Invoke db:create (first_time)\r\n** Invoke db:load_config (first_time)\r\n** Execute db:load_config\r\n** Execute db:create\r\nglobal_uids_1 already exists\r\nglobal_uids_2 already exists\r\n** Invoke db:structure:load (first_time)\r\n** Invoke environment (first_time)\r\n** Execute environment\r\n** Execute db:structure:load\r\nvoyager_development: Loading structure from /opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/zendesk_database_migrations-3/db/structure_main.sql\r\nvoyager_development_shard_1: Loading structure from /opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/zendesk_database_migrations-3/db/structure_shard.sql\r\n** Invoke db:seed (first_time)\r\n** Execute db:seed\r\n** Invoke db:abort_if_pending_migrations (first_time)\r\n** Invoke environment\r\n** Execute db:abort_if_pending_migrations\r\nrake aborted!\r\nNoMethodError: undefined method `group_by' for \"db/migrate\":String\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:1013:in `validate'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:920:in `initialize'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/active_record_shards-3.3.0/lib/active_record_shards/tasks.rb:49:in `new'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/active_record_shards-3.3.0/lib/active_record_shards/tasks.rb:49:in `block (3 levels) in <top (required)>'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/active_record_shards-3.3.0/lib/active_record_shards/connection_switcher.rb:18:in `on_shard'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/active_record_shards-3.3.0/lib/active_record_shards/tasks.rb:49:in `block (2 levels) in <top (required)>'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:179:in `block (2 levels) in <top (required)>'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/zendesk_database_migrations-3/lib/zendesk_database_migrations/tasks/shared.rake:141:in `block (2 levels) in <top (required)>'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'\r\n/opt/boxen/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'\r\n/opt/boxen/rbenv/versions/2.1.5/bin/rake:23:in `load'\r\n/opt/boxen/rbenv/versions/2.1.5/bin/rake:23:in `<main>'\r\nTasks: TOP => db:abort_if_pending_migrations\r\n```\r\n\r\n/cc @gabetax @osheroff @staugaard @grosser \r\n\r\n### References\r\n - Jira link:\r\n\r\n### Risks\r\n - None"},"comment":{"url":"https://api.github.com/repos/zendesk/active_record_shards/issues/comments/70859672","html_url":"https://github.com/zendesk/active_record_shards/pull/34#issuecomment-70859672","issue_url":"https://api.github.com/repos/zendesk/active_record_shards/issues/34","id":70859672,"user":{"login":"osheroff","id":260084,"avatar_url":"https://avatars.githubusercontent.com/u/260084?v=3","gravatar_id":"","url":"https://api.github.com/users/osheroff","html_url":"https://github.com/osheroff","followers_url":"https://api.github.com/users/osheroff/followers","following_url":"https://api.github.com/users/osheroff/following{/other_user}","gists_url":"https://api.github.com/users/osheroff/gists{/gist_id}","starred_url":"https://api.github.com/users/osheroff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osheroff/subscriptions","organizations_url":"https://api.github.com/users/osheroff/orgs","repos_url":"https://api.github.com/users/osheroff/repos","events_url":"https://api.github.com/users/osheroff/events{/privacy}","received_events_url":"https://api.github.com/users/osheroff/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T15:40:58Z","updated_at":"2015-01-21T15:40:58Z","body":":+1: "}}