Module: Challah::UserAttributeable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Userable
- Defined in:
- lib/challah/concerns/user/attributeable.rb
Instance Method Summary collapse
-
#active? ⇒ Boolean
Returns true if this user is active, and should be able to log in.
-
#name ⇒ Object
First name and last name together.
-
#small_name ⇒ Object
shortened name, just includes the first name and last initial.
-
#valid_session? ⇒ Boolean
Is this user valid and ready for a user session?.
Instance Method Details
#active? ⇒ Boolean
Returns true if this user is active, and should be able to log in. If the active column is false, the user will not be able to authenticate
15 16 17 |
# File 'lib/challah/concerns/user/attributeable.rb', line 15 def active? !!self.active end |
#name ⇒ Object
First name and last name together
20 21 22 |
# File 'lib/challah/concerns/user/attributeable.rb', line 20 def name "#{ first_name } #{ last_name }".strip end |
#small_name ⇒ Object
shortened name, just includes the first name and last initial
25 26 27 |
# File 'lib/challah/concerns/user/attributeable.rb', line 25 def small_name "#{ first_name.to_s.titleize } #{ last_name.to_s.first.upcase }." end |
#valid_session? ⇒ Boolean
Is this user valid and ready for a user session?
Override this method if you need to check for a particular configuration on each page request.
32 33 34 |
# File 'lib/challah/concerns/user/attributeable.rb', line 32 def valid_session? self.active? end |