Declare an enum attribute where the values map to integers in the database, but can be queried by name. Example: class User < ActiveRecord::Base enum status: [ :admin, :user, :banned ] end For migration, write def up create_table :authorities do […]
This step by step how to is intended to be a reference for those who are comfortable with working in terminals. This page lists all the commands on one place.
This website uses cookies to provide necessary website functionality, improve your experience and analyze our traffic. By using our website, you agree to our Privacy Policy and our cookies usage.