rails_upgrader icon indicating copy to clipboard operation
rails_upgrader copied to clipboard

Update migration class name with Rails version

Open bronzdoc opened this issue 4 years ago • 2 comments

rails g model User name:string

will generate migration as shown below.

class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|
      t.string :name
      t.timestamps null: false
    end
  end
end

In Rails 5 the same command will generate following migration.

class CreateUsers < ActiveRecord::Migration[5.0]
  def change
    create_table :users do |t|
      t.string :name
      t.timestamps
    end
  end
end

bronzdoc avatar Mar 05 '21 01:03 bronzdoc

hey @bronzdoc I think you mixed the title of the issue with the description of another issue here

arielj avatar Mar 05 '21 12:03 arielj

@arielj fixed it 👍

bronzdoc avatar Mar 05 '21 16:03 bronzdoc