user activation on creation/edit

This commit is contained in:
Mark Moser 2015-10-23 19:57:32 -05:00
parent 7ddf93578e
commit 0d597813ec
5 changed files with 28 additions and 6 deletions

View File

@ -4,6 +4,9 @@ A simple app to send sms messages with [twillio](https://www.twilio.com/).
## Configure
- set up twilio account
- create google apps oauth app
### Secrets file:
`config/application.yml` is read at boot and shoves the values into `ENV`.
@ -13,8 +16,7 @@ A simple app to send sms messages with [twillio](https://www.twilio.com/).
3. Make *ABSOLUTE* certain that this file is not checked into your repository.
## TODO
* activation flag on user edit
* verify roles access
* application log
* task runner - delayedjob or sidekiq or activerecord newness?
* milestone 1.0.0
- milestone 1.0.0
- decent UX
- application log
- task runner - delayedjob or sidekiq or activerecord newness?

View File

@ -60,7 +60,8 @@ class UsersController < ApplicationController
:phone,
:email,
:admin,
:staff
:staff,
:active
)
end
end

View File

@ -38,6 +38,18 @@ class Person < ActiveRecord::Base
activation_state == "active"
end
def active
activation_state == 'active'
end
def active=(bool)
if bool
self.activation_state = 'active'
else
self.ctivation_state = nil
end
end
private
## SorceryCore expects the model to hold a crypted_password field

View File

@ -26,4 +26,7 @@
= f.label :staff
= f.check_box :staff
= f.label :active
= f.check_box :active
= f.submit

View File

@ -6,6 +6,10 @@
%p Email: #{mail_to(@user.email, nil, encode: 'hex')}
%p Phone: #{number_to_phone @user.phone} #{page_link(@user)}
%p Admin: #{@user.admin?}
%p Staff: #{@user.staff?}
%p Account Active: #{@user.active?}
%p Has Signed in: #{!@user.authentications.blank?}
- unless @user.children.empty?
%p Children: