Sha256: 02db840e459f97a3d3f7967c883838f63e31c71aef06cf181fd82a173999fa68
Contents?: true
Size: 559 Bytes
Versions: 62
Compression:
Stored size: 559 Bytes
Contents
class Party < ActiveRecord::Base has_many :periods, :order => :position, :dependent => :destroy def to_sym self.class.name.downcase.to_sym end def controller self.class.name.downcase.pluralize end def icon to_sym.to_s + '.png' end def current_speed completed_periods = periods.select {|p| p.end_on < Date.today} if last_completed = completed_periods.last last_completed.speed elsif active_period = periods.to_ary.find {|p| p.active?} active_period.speed else 0 end end end
Version data entries
62 entries across 62 versions & 1 rubygems