I'm learning Ruby on Rails by example. I see in migration folder here is one sample code:
class RemoveOrderListNumberAndStateFromOrderLists < ActiveRecord::Migration[5.0]
def up
remove_column :order_lists, :order_list_number
remove_column :order_lists, :state
end
def down
add_column :order_lists, :order_list_number, :string
add_column :order_lists, :state, :integer
end
end
The thing I don't know is at this line:
class RemoveOrderListNumberAndStateFromOrderLists < ActiveRecord::Migration[5.0]
I know this command means: create a class, that is a subclass of ActiveRecord::Migration
and also 5.0 is rails version of project. Thing that I don't know is: which ruby grammar name that allow you declare [number]
after class in above case. I think the only way is an array, but not likely true in this case.
thanks