ユーザー認証を備えた有効な Rails アプリケーションがあります。私は自分のアカウントを自動的にコーディングしたいと考えています。なぜなら、私は管理者の役割を持ち、他の誰もそうしないからです。これを行う方法はありますか?
ところで、私の db/migrate テーブルは次のようになります。
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :first_name
t.string :last_name
t.string :email
t.string :password_digest
t.string :role, default => 'reader'
t.timestamps null: false
end
end
end