Class: Gaku::ClassGroup
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Gaku::ClassGroup
- Includes:
- Enrollmentable, Notes, Pagination, Semesterable, StudentReviewable
- Defined in:
- app/models/gaku/class_group.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.active ⇒ Object
14 15 16 |
# File 'app/models/gaku/class_group.rb', line 14 def self.active @active = joins(:semesters).merge(Gaku::Semester.active).uniq end |
.for_select ⇒ Object
8 9 10 11 12 |
# File 'app/models/gaku/class_group.rb', line 8 def self.for_select %w(active upcomming).map do |state| [state.humanize, send(state).map { |cg| [cg.to_s, cg.id] }] end end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'app/models/gaku/class_group.rb', line 22 def to_s "#{grade} - #{name}" end |