app/importers/rows/behavior_row.rb
# Represents a row in a CSV export from Somerville's Aspen X2 student information system.
#
# Expects the following headers:
#
#  :state_id, :local_id, :incident_code, :event_date, :incident_time,
#  :incident_location, :incident_description, :school_local_id
Represents a row in a CSV export from Somerville's Aspen X2 student information system.
Expects the following headers.


Represents a row in a CSV export from Somerville ' s Aspen X2 student information system . Expects the following headers .
def build
    DisciplineIncident.find_or_initialize_by(
      occurred_at: occurred_at,
      student_id: student_id,
      incident_code: row[:incident_code],
      has_exact_time: has_exact_time?,
      incident_location: row[:incident_location],
      incident_description: row[:incident_description],
    )
  end
def build DisciplineIncident . find_or_initialize_by ( occurred_at : occurred_at , student_id : student_id , incident_code : row [ :incident_code ] , has_exact_time : has_exact_time? , incident_location : row [ :incident_location ] , incident_description : row [ :incident_description ] , ) end
Represents a row in a CSV export from Somerville's Aspen X2 student information system.
Represents a row in a CSV export from Somerville ' s Aspen X2 student information system .
# This method is picky. A record must exactly match every field in a row # in order to `find`; otherwise a new record is `initialized`. # If any attributes change upstream in Aspen/X2, the record in the Insights # database won't be marked by and will be deleted at the end of the import task.