Class: Gaku::GradingMethodSet

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/gaku/grading_method_set.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.primaryObject



10
11
12
# File 'app/models/gaku/grading_method_set.rb', line 10

def self.primary
  where(primary: true).first
end

Instance Method Details

#itemsObject



19
20
21
# File 'app/models/gaku/grading_method_set.rb', line 19

def items
  grading_method_set_items
end

#make_primaryObject



14
15
16
17
# File 'app/models/gaku/grading_method_set.rb', line 14

def make_primary
  GradingMethodSet.where.not(id: id).update_all(primary: false)
  update_attribute(:primary, true)
end