From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QXxfl-0002Ny-4g for garchives@archives.gentoo.org; Sat, 18 Jun 2011 15:42:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 521611C052; Sat, 18 Jun 2011 15:42:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1189E1C052 for ; Sat, 18 Jun 2011 15:42:34 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 77D4B1B4037 for ; Sat, 18 Jun 2011 15:42:34 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 8EF488004B for ; Sat, 18 Jun 2011 15:42:33 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: Subject: [gentoo-commits] proj/council-webapp:master commit in: site/app/models/ X-VCS-Repository: proj/council-webapp X-VCS-Files: site/app/models/agenda.rb site/app/models/proxy.rb site/app/models/user.rb X-VCS-Directories: site/app/models/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: e3d89bd4b32a0348eca0a736261d32d625345717 Date: Sat, 18 Jun 2011 15:42:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 485e85c5a4619d252d79576dc2f188fc commit: e3d89bd4b32a0348eca0a736261d32d625345717 Author: Joachim Filip Ignacy Bartosik gmail com= > AuthorDate: Mon Jun 13 13:04:32 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Fri Jun 17 18:39:26 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/council-webap= p.git;a=3Dcommit;h=3De3d89bd4 Change names to communicative To improve UncommunicativeName reports --- site/app/models/agenda.rb | 28 ++++++++++++++-------------- site/app/models/proxy.rb | 6 +++--- site/app/models/user.rb | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/site/app/models/agenda.rb b/site/app/models/agenda.rb index 8f05e09..16dc2e7 100644 --- a/site/app/models/agenda.rb +++ b/site/app/models/agenda.rb @@ -43,8 +43,8 @@ class Agenda < ActiveRecord::Base true end =20 - before_create do |a| - a.meeting_time ||=3D Time.now + before_create do |agenda| + agenda.meeting_time ||=3D Time.now end =20 def self.current @@ -58,14 +58,14 @@ class Agenda < ActiveRecord::Base end =20 def self.process_results(results) - a =3D Agenda.current + agenda =3D Agenda.current for item_title in results.keys - i =3D AgendaItem.first :conditions =3D> { :agenda_id =3D> a, :titl= e =3D> item_title } + item =3D AgendaItem.first :conditions =3D> { :agenda_id =3D> agend= a, :title =3D> item_title } votes =3D results[item_title] for voter in votes.keys - o =3D VotingOption.first :conditions =3D> { :agenda_item_id =3D>= i.id, :description =3D> votes[voter] } - u =3D ::User.find_by_irc_nick voter - Vote.create! :voting_option =3D> o, :user =3D> u + option =3D VotingOption.first :conditions =3D> { :agenda_item_id= =3D> item.id, :description =3D> votes[voter] } + user =3D ::User.find_by_irc_nick voter + Vote.create! :voting_option =3D> option, :user =3D> user end end end @@ -137,16 +137,16 @@ class Agenda < ActiveRecord::Base 'users' =3D> Agenda.voters} end =20 - before_save do |a| - return true if a.new_record? - return true unless a.meeting_time_changed? - a.email_reminder_sent =3D false + before_save do |agenda| + return true if agenda.new_record? + return true unless agenda.meeting_time_changed? + agenda.email_reminder_sent =3D false true end =20 - after_save do |a| - if a.new_record? or a.meeting_time_changed? - Agenda.delay(:run_at =3D> a.time_for_reminders(:email)).send_curre= nt_agenda_reminders + after_save do |agenda| + if agenda.new_record? or agenda.meeting_time_changed? + Agenda.delay(:run_at =3D> agenda.time_for_reminders(:email)).send_= current_agenda_reminders end end =20 diff --git a/site/app/models/proxy.rb b/site/app/models/proxy.rb index 7be0a0b..1fdb93f 100644 --- a/site/app/models/proxy.rb +++ b/site/app/models/proxy.rb @@ -40,9 +40,9 @@ class Proxy < ActiveRecord::Base true end =20 - before_create do |p| - p.council_member_nick =3D p.council_member.irc_nick - p.proxy_nick =3D p.proxy.irc_nick + before_create do |proxy| + proxy.council_member_nick =3D proxy.council_member.irc_nick + proxy.proxy_nick =3D proxy.proxy.irc_nick end =20 protected diff --git a/site/app/models/user.rb b/site/app/models/user.rb index 087f0fe..0ca3e33 100644 --- a/site/app/models/user.rb +++ b/site/app/models/user.rb @@ -66,9 +66,9 @@ class User < ActiveRecord::Base end end =20 - a =3D ['Was on last meeting', 'Skipped last meeting', + text_statuses =3D ['Was on last meeting', 'Skipped last meeting', 'Slacker', 'No more a council'] - a[num_status] + text_statuses[num_status] end =20 def can_appoint_a_proxy?(user)