You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4 before_filter :force_approved_account
5 before_filter :redirect_suspended_account
6
7 def force_approved_account
8 # We will redirect to the approval page if a user is signed in, is not an admin and is marked as waiting for approval
9 redirect = user_signed_in? && !current_user.is_admin? && current_user.status.waiting_approval?
10
11 redirect_to approval_path if redirect
12 end
13
14 def redirect_suspended_account
The text was updated successfully, but these errors were encountered:
Could it somehow be a toggle in config/permissions.yml or something, where you can set public or private, and if it's public, then have it be active, or if its private, then pending?
This only happens if you are updating from 1.0 to 1.1 and had users in your database. I think it is safe to assume that if you had users in the system you still want those users as active.
Another option would be to find a way to get rake db:migrate to read from the config file where there is a variable for the site to be public or private and set the status accordingly but I think this is kind of overkill.
Reset to v1.0
Create a non-admin user and login
Make a backup copy of the DB
Switch back to master
Return to broswer and access site. Error undefined method `waiting_approval?' for nil:NilClass will occur.
force_approved_accountapp/controllers/application_controller.rb
The text was updated successfully, but these errors were encountered: