You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
801 B
28 lines
801 B
class Sped < ApplicationRecord
|
|
scope :by_designation, -> { all.map { |sped| [sped.designation, sped] }.to_h }
|
|
|
|
include FriendlyId
|
|
|
|
friendly_id :designation, use: [:slugged]
|
|
def self.to_designation(sped)
|
|
return "Not Special Education" if sped.blank? || sped.nil?
|
|
|
|
case sped
|
|
in /active|^A$|1|Special\s*Education/i
|
|
"Special Education"
|
|
in /^I$|exited|0|Not\s*Special\s*Education/i
|
|
"Not Special Education"
|
|
in /^NA$|^#NA$|Unknown/i
|
|
"Unknown"
|
|
else
|
|
puts "************************************"
|
|
puts "******** ERROR **********"
|
|
puts ""
|
|
puts "Error parsing Special Education column. '#{sped}' is not a known value. Halting execution"
|
|
puts ""
|
|
puts "************************************"
|
|
exit
|
|
end
|
|
end
|
|
end
|