blob: b7ca39aa21dd290a56955e1ab559cc7a2dc5abb4 (
plain)
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
|
class Participation < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
irc_nick :string
timestamps
end
belongs_to :participant, :class_name => 'User'
belongs_to :agenda
# --- Permissions --- #
def create_permitted?
false
end
def update_permitted?
false
end
def destroy_permitted?
false
end
def view_permitted?(field)
true
end
def name
participant.name
end
def self.mark_participations(results)
participant_nicks = results.values.*.keys.flatten.uniq
agenda = Agenda.current
for nick in participant_nicks
user = ::User.find_by_irc_nick(nick)
next if user.nil?
Participation.create! :irc_nick => user.irc_nick,
:participant => user,
:agenda => agenda
end
end
end
|