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

Instance Method Details

#detailsObject



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

Returns:

  • (Boolean)


170
171
172
# File 'app/models/concerns/effective_mentorships_registration.rb', line 170

def either?
  venue == 'Either'
end

#in_person?Boolean

Venues

Returns:

  • (Boolean)


162
163
164
# File 'app/models/concerns/effective_mentorships_registration.rb', line 162

def in_person?
  venue == 'In-person'
end

#mentee?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


153
154
155
# File 'app/models/concerns/effective_mentorships_registration.rb', line 153

def mentor?
  mentorship_role.to_s == 'mentor'
end

#short_categoryObject



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_sObject

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

Returns:

  • (Boolean)


166
167
168
# File 'app/models/concerns/effective_mentorships_registration.rb', line 166

def virtual?
  venue == 'Virtual'
end