"Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for"

This commit is contained in:
Akira Matsuda 2017-01-06 22:49:55 +09:00
parent 2b0a7708e6
commit 66a0d50baf
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ class Device < Product
end
#migrations
class CreateAllTables < ActiveRecord::Migration
class CreateAllTables < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
create_table(:gem_defined_models) { |t| t.string :name; t.integer :age }
create_table(:users) {|t| t.string :name; t.integer :age}