module PeopleHelper

Public Instance Methods

abbreviate_category(category) click to toggle source
# File app/helpers/people_helper.rb, line 40
def abbreviate_category(category)
  case category
  when %rBegin/
    "Beg"
  when %rClyde/
    "Clyd"
  else
    category
  end
end
administrator?() click to toggle source

Is current Person an administrator?

# File app/helpers/people_helper.rb, line 3
def administrator?
  current_person.try :administrator?
end
editor_for?(person, *attributes, &block) click to toggle source

Can current_person edit person?

# File app/helpers/people_helper.rb, line 18
def editor_for?(person, *attributes, &block)
  subject = case person
  when Person
    person
  else
    person.try :person
  end
    
  if ((attributes && (attributes.any? { |a| person[a].blank? || subject[a].blank? })) || current_person.can_edit?(subject)) && block
    capture(&block)
  end
end
official?() click to toggle source

Is current Person an official?

# File app/helpers/people_helper.rb, line 13
def official?
  current_person.try :official?
end
promoter?() click to toggle source

Is current Person a promoter?

# File app/helpers/people_helper.rb, line 8
def promoter?
  current_person.try :promoter?
end
pronoun(person, other_person) click to toggle source

‘me’ or person name

# File app/helpers/people_helper.rb, line 32
def pronoun(person, other_person)
  if person == other_person
    "me"
  else
    person.name
  end
end