Use AR version for migrations

This commit is contained in:
Pablo Acuna 2017-05-27 12:27:40 -04:00 committed by Anil Kumar Maurya
parent 1ef5c17c41
commit 5b764e796e
2 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
class AASMCreate<%= table_name.camelize %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
class AASMCreate<%= table_name.camelize %> < ActiveRecord::Migration[<%= ActiveRecord::VERSION::STRING.to_f %>]
def change
create_table(:<%= table_name %>) do |t|
t.string :<%= column_name %>

View File

@ -1,4 +1,4 @@
class Add<%= column_name.camelize %>To<%= table_name.camelize %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
class Add<%= column_name.camelize %>To<%= table_name.camelize %> < ActiveRecord::Migration[<%= ActiveRecord::VERSION::STRING.to_f %>]
def change
add_column :<%= table_name %>, :<%= column_name %>, :string
end