Rails 5から、attributes APIという機能がActive Recordに追加されました。attributes APIは、既に存在するattributeのtypeを上書きしたり、任意のattributeを定義出来る機能です。 言葉で説明してもイマイチわかりずらいので、早速例を見てみましょう。 create_table "books", force: :cascade do |t| t.string "name" t.integer "price" t.date "published_on" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "out_of_print", default: "false" end class Book < ApplicationR