Class: Gaku::GradingMethodSet
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Gaku::GradingMethodSet
- Defined in:
- app/models/gaku/grading_method_set.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.primary ⇒ Object
10 11 12 |
# File 'app/models/gaku/grading_method_set.rb', line 10 def self.primary where(primary: true).first end |
Instance Method Details
#items ⇒ Object
19 20 21 |
# File 'app/models/gaku/grading_method_set.rb', line 19 def items grading_method_set_items end |
#make_primary ⇒ Object
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 |