I recently used the Pundit gem with Rails 4 using devise. Pundit is a standalone Rolify-independent system, in accordance with my experience.
Instead of using Rolify, I created a migration to add roles to an existing user table, which allows you to assign roles to users and check what roles they have.
Please take a look at the diagram I created for my project:
create_table "users", force: true do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.datetime "created_at" t.datetime "updated_at" **t.boolean "is_admin" t.boolean "is_daily_user"
If the is_admin and is_daily_user fields are added for user roles.
Hope this helps!
Ekta Verma
source share