Skip to content

Instantly share code, notes, and snippets.

@khoan
Created July 20, 2012 02:33
Show Gist options
  • Save khoan/3148293 to your computer and use it in GitHub Desktop.
Save khoan/3148293 to your computer and use it in GitHub Desktop.
Devise Authentication unscoped
# Our User model with default_scope of active users,
# and a :vip scope
#
class User
include Mongoid::Document
field :status
# now only active users can be authenticated
default_scope where(status: 'active')
scope :vip, where(status: 'vip')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment