Skip to content

Commit

Permalink
Change names to communicative
Browse files Browse the repository at this point in the history
To improve UncommunicativeName reports
  • Loading branch information
jbartosik committed Jun 17, 2011
1 parent 2b881b6 commit e3d89bd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
28 changes: 14 additions & 14 deletions site/app/models/agenda.rb
Expand Up @@ -43,8 +43,8 @@ def view_permitted?(field)
true
end

before_create do |a|
a.meeting_time ||= Time.now
before_create do |agenda|
agenda.meeting_time ||= Time.now
end

def self.current
Expand All @@ -58,14 +58,14 @@ def self.transitions_available(user)
end

def self.process_results(results)
a = Agenda.current
agenda = Agenda.current
for item_title in results.keys
i = AgendaItem.first :conditions => { :agenda_id => a, :title => item_title }
item = AgendaItem.first :conditions => { :agenda_id => agenda, :title => item_title }
votes = results[item_title]
for voter in votes.keys
o = VotingOption.first :conditions => { :agenda_item_id => i.id, :description => votes[voter] }
u = ::User.find_by_irc_nick voter
Vote.create! :voting_option => o, :user => u
option = VotingOption.first :conditions => { :agenda_item_id => item.id, :description => votes[voter] }
user = ::User.find_by_irc_nick voter
Vote.create! :voting_option => option, :user => user
end
end
end
Expand Down Expand Up @@ -137,16 +137,16 @@ def self.irc_reminders
'users' => Agenda.voters}
end

before_save do |a|
return true if a.new_record?
return true unless a.meeting_time_changed?
a.email_reminder_sent = false
before_save do |agenda|
return true if agenda.new_record?
return true unless agenda.meeting_time_changed?
agenda.email_reminder_sent = false
true
end

after_save do |a|
if a.new_record? or a.meeting_time_changed?
Agenda.delay(:run_at => a.time_for_reminders(:email)).send_current_agenda_reminders
after_save do |agenda|
if agenda.new_record? or agenda.meeting_time_changed?
Agenda.delay(:run_at => agenda.time_for_reminders(:email)).send_current_agenda_reminders
end
end

Expand Down
6 changes: 3 additions & 3 deletions site/app/models/proxy.rb
Expand Up @@ -40,9 +40,9 @@ def view_permitted?(field)
true
end

before_create do |p|
p.council_member_nick = p.council_member.irc_nick
p.proxy_nick = p.proxy.irc_nick
before_create do |proxy|
proxy.council_member_nick = proxy.council_member.irc_nick
proxy.proxy_nick = proxy.proxy.irc_nick
end

protected
Expand Down
4 changes: 2 additions & 2 deletions site/app/models/user.rb
Expand Up @@ -66,9 +66,9 @@ def slacking_status_in_period(start_date, end_date)
end
end

a = ['Was on last meeting', 'Skipped last meeting',
text_statuses = ['Was on last meeting', 'Skipped last meeting',
'Slacker', 'No more a council']
a[num_status]
text_statuses[num_status]
end

def can_appoint_a_proxy?(user)
Expand Down

0 comments on commit e3d89bd

Please sign in to comment.