Module: EffectiveMentorshipsRegistration
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/effective_mentorships_registration.rb
Overview
EffectiveMentorshipsRegistration
Mark your group model with effective_mentorships_registration to get all the includes
Defined Under Namespace
Modules: Base, ClassMethods
Instance Method Summary collapse
- #details ⇒ Object
- #either? ⇒ Boolean
-
#in_person? ⇒ Boolean
Venues.
- #mentee? ⇒ Boolean
-
#mentor? ⇒ Boolean
Mentorship roles.
- #short_category ⇒ Object
-
#to_s ⇒ Object
Instance Methods.
- #virtual? ⇒ Boolean
Instance Method Details
#details ⇒ Object
143 144 145 146 147 148 149 150 |
# File 'app/models/concerns/effective_mentorships_registration.rb', line 143 def details [ short_category.presence, venue.presence, location.presence, ("Limit #{mentor_multiple_mentees_limit}" if mentor? && mentor_multiple_mentees_limit.present?) ].compact.join(', ').html_safe end |
#either? ⇒ Boolean
170 171 172 |
# File 'app/models/concerns/effective_mentorships_registration.rb', line 170 def either? venue == 'Either' end |
#in_person? ⇒ Boolean
Venues
162 163 164 |
# File 'app/models/concerns/effective_mentorships_registration.rb', line 162 def in_person? venue == 'In-person' end |
#mentee? ⇒ Boolean
157 158 159 |
# File 'app/models/concerns/effective_mentorships_registration.rb', line 157 def mentee? mentorship_role.to_s == 'mentee' end |
#mentor? ⇒ Boolean
Mentorship roles
153 154 155 |
# File 'app/models/concerns/effective_mentorships_registration.rb', line 153 def mentor? mentorship_role.to_s == 'mentor' end |
#short_category ⇒ Object
138 139 140 141 |
# File 'app/models/concerns/effective_mentorships_registration.rb', line 138 def short_category return category unless category.to_s.include?('(') && category.to_s.include?(')') category.to_s.split('(').first.strip end |
#to_s ⇒ Object
Instance Methods
134 135 136 |
# File 'app/models/concerns/effective_mentorships_registration.rb', line 134 def to_s title.presence || model_name.human end |
#virtual? ⇒ Boolean
166 167 168 |
# File 'app/models/concerns/effective_mentorships_registration.rb', line 166 def virtual? venue == 'Virtual' end |