class ExerciseBank < ActiveRecord::Base belongs_to :user belongs_to :course_list has_many :exercise_bank_questions, :dependent => :destroy, :order => "#{ExerciseBankQuestion.table_name}.question_number" attr_accessible :container_id, :container_type, :description, :is_public, :name, :quotes, :user_id, :course_list_id, :created_at, :updated_at def course_list_name self.course_list ? self.course_list.name : "" end end