Class: UserAbility
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- UserAbility
- Defined in:
- /var/apps/qpixel/app/models/user_ability.rb
Instance Method Summary collapse
-
#suspended? ⇒ Boolean
Is the ability temporarily or permanently suspended?.
Methods inherited from ApplicationRecord
#attributes_print, fuzzy_search, match_search, #match_search, sanitize_for_search, sanitize_name, sanitize_sql_in, useful_err_msg, with_lax_group_rules
Instance Method Details
#suspended? ⇒ Boolean
Is the ability temporarily or permanently suspended?
7 8 9 10 11 12 13 14 15 16 |
# File '/var/apps/qpixel/app/models/user_ability.rb', line 7 def suspended? return true if is_suspended && suspension_end.nil? # permanent suspension return true if is_suspended && !suspension_end.past? if is_suspended update(is_suspended: false, suspension_message: nil, suspension_end: nil) end false end |