Sha256: d3f5fdab674c123f666a4f24e22fb54a32ccd55c32c8c9825fdd289d451331fe
Contents?: true
Size: 605 Bytes
Versions: 14
Compression:
Stored size: 605 Bytes
Contents
module Merit class Score < ActiveRecord::Base self.table_name = :merit_scores belongs_to :sash has_many :score_points, dependent: :destroy, class_name: 'Merit::Score::Point' def points score_points.group(:score_id).sum(:num_points).values.first || 0 end class Point < ActiveRecord::Base belongs_to :score, class_name: 'Merit::Score' has_one :sash, through: :score has_many :activity_logs, class_name: 'Merit::ActivityLog', as: :related_change delegate :sash_id, to: :score end end end
Version data entries
14 entries across 14 versions & 1 rubygems