Class: NextSges::School

Inherits:
ApplicationRecord show all
Defined in:
app/models/next_sges/school.rb

Constant Summary collapse

INITIAL_LETTER =
"C"

Constants inherited from ApplicationRecord

ApplicationRecord::CELL_REGEX, ApplicationRecord::DEFAULT_IDENTIFICATION_ENUM, ApplicationRecord::DEFAULT_STATUS_ENUM, ApplicationRecord::MAIL_REGEX

Instance Method Summary collapse

Methods inherited from ApplicationRecord

#create_number, #create_number!, map_for_filter, map_for_select

Instance Method Details

#expected_valueObject



38
39
40
# File 'app/models/next_sges/school.rb', line 38

def expected_value
  collection_notes.by_month.by_year.sum(:value)
end

#name_and_numberObject



30
31
32
# File 'app/models/next_sges/school.rb', line 30

def name_and_number
  "#{number} - #{name}"
end

#receive_valueObject



34
35
36
# File 'app/models/next_sges/school.rb', line 34

def receive_value
  collection_notes.by_month.by_year.where(status: 2).sum(:value)
end