{"push_id":2517040457,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"a41dce832c3da1b31628fdc1d707a1254ac85ee2","before":"d91692fddc58c8afcd165a57f189522a30dd2c45","commits":[{"sha":"a41dce832c3da1b31628fdc1d707a1254ac85ee2","author":{"name":"Koichi ITO","email":"62fb6e080cf43b35af11716cc49ab9063e71c433@gmail.com"},"message":"[Fix #5821] Support `AR::Migration#up_only` for `Rails/ReversibleMigration`\n\nFixes #5821.\n\nThis PR supports the following `AR::Migration#up_only` method.\n\n```console\n% cat db/migrate/example.rb\nclass AddPublishedToPosts < ActiveRecord::Migration[5.2]\n  def change\n    add_column :posts, :published, :boolean, default: false\n\n    up_only do\n      execute \"UPDATE posts SET published = 'true'\"\n    end\n  end\nend\n```\n\nhttp://api.rubyonrails.org/classes/ActiveRecord/Migration.html#method-i-up_only\n\nThis PR fixes the following false posive when using Rails 5.2.0.\n\n```console\n% rubocop db/migrate/example.rb --only Rails/ReversibleMigration\nInspecting 1 file\nC\n\nOffenses:\n\ndb/migrate/example.rb:6:7: C: Rails/ReversibleMigration: execute is not\nreversible.\n      execute \"UPDATE posts SET published = 'true'\"\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n1 file inspected, 1 offense detected\n```","distinct":true,"url":"https://api.github.com/repos/bbatsov/rubocop/commits/a41dce832c3da1b31628fdc1d707a1254ac85ee2"}]}
{"actor":{"display_login":"bbatsov"}}