Module PeopleHelper
In: app/helpers/people_helper.rb

Methods

Public Instance methods

Is current Person an administrator?

[Source]

   # File app/helpers/people_helper.rb, line 3
3:   def administrator?
4:     current_person.try :administrator?
5:   end

Can current_person edit person?

[Source]

    # File app/helpers/people_helper.rb, line 18
18:   def editor_for?(person, *attributes, &block)
19:     subject = case person
20:     when Person
21:       person
22:     else
23:       person.try :person
24:     end
25:       
26:     if (attributes && (attributes.any? { |a| person[a].blank? || subject[a].blank? })) || current_person.can_edit?(subject)
27:       if block
28:         concat capture(&block)
29:       else
30:         true
31:       end
32:     else
33:       false
34:     end
35:   end

Is current Person an official?

[Source]

    # File app/helpers/people_helper.rb, line 13
13:   def official?
14:     current_person.try :official?
15:   end

Is current Person a promoter?

[Source]

    # File app/helpers/people_helper.rb, line 8
 8:   def promoter?
 9:     current_person.try :promoter?
10:   end

‘me’ or person name

[Source]

    # File app/helpers/people_helper.rb, line 38
38:   def pronoun(person, other_person)
39:     if person == other_person
40:       "me"
41:     else
42:       person.name
43:     end
44:   end

[Validate]