i trying setup model based on pre-built model has following code in migration:
def change create_table :friendships |t| t.string :user_id, :friend_user_id t.string :status end end
i t.string :status
part column being created use string. don't understand t.string :user_id, :friend_user_id
part there 2 attributes on same line.
in first line, 2 columns being created named user_id
, friend_user_id
having string data type. in second line there column being created named status
having string data type. in migrations can write column names in 1 line have same data type. i.e. migration can written this.
def change create_table :friendships |t| t.string :user_id, :friend_user_id, :status end end
Comments
Post a Comment