0 votes
in Ruby by

You made a spelling mistake while creating a table for bank accounts. Which code would you expect to see in a migration to fix the error?

 A.

class IAmADummy < ActiveRecord::Migration

  def change

    rename_column :accounts, :account_hodler, :account_holder

  end

end

 B.

class FixSpellling < ActiveRecord::Migration

  def change

    rename :accounts, :account_hodler, :account_holder

  end

end

 C.

class CoffeeNeeded < ActiveRecord::Migration

  def change

    remove_column :accounts, :account_hodler

    add_column :accounts, :account_holder

  end

end

 D.

class OopsIDidItAgain < ActiveRecord::Migration

  def rename

    :accounts, :account_hodler, :account_holder

  end

end

1 Answer

0 votes
by

Correct answer is :- 

class IAmADummy < ActiveRecord::Migration

  def change

    rename_column :accounts, :account_hodler, :account_holder

  end

end

...