person.rb
833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# encoding: utf-8
require_dependency 'person'
class Person
settings_items :percentage_incomplete, :type => :string, :default => ""
attr_accessible :percentage_incomplete
delegate :login, :to => :user, :prefix => true
def institutions
institutions = []
unless self.user.institutions.nil?
self.user.institutions.each do |institution|
institutions << institution.name
end
end
institutions
end
def secondary_email
self.user.secondary_email unless self.user.nil?
end
def secondary_email= value
self.user.secondary_email = value unless self.user.nil?
end
def software?
false
end
def softwares
softwares = []
self.communities.each do |community|
if community.software?
softwares << community
end
end
softwares
end
end