Created
October 11, 2012 19:55
-
-
Save DougHall/3875089 to your computer and use it in GitHub Desktop.
ScoreSession model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScoreSession < ActiveRecord::Base | |
belongs_to :assessor, :class_name => "User" | |
has_many :station_scores, :dependent => :destroy | |
has_many :trainees, :through => :station_scores | |
attr_accessor :cluster, :line | |
validates_presence_of :cluster, :line | |
accepts_nested_attributes_for :station_scores, :reject_if => :all_blank | |
def cluster_val | |
self.cluster.split('..').inject { |s,e| s.to_i..e.to_i } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment