The following simple code in a migration file in Ruby on Rails :
def change
create_table :articles do |t|
t.string :title
end
Can I understand it like that :
1: create_table
is a ruby built-in ( or Ruby on Rails ? ) to create a table
2: :articles
is the table name, so clear
3: This is the most important for me to illustrate in my brain. do |t|
means to execute what is behind it ? this is mean do
will add the table in the database, and gives it the value t
???