Skip to content

Instantly share code, notes, and snippets.

@raymyers
Created July 29, 2009 18:21
Show Gist options
  • Save raymyers/158316 to your computer and use it in GitHub Desktop.
Save raymyers/158316 to your computer and use it in GitHub Desktop.
def deep_attributes
self.attributes.merge 'service_appointments_attributes'=>service_appointments.collect{|sa|
sa.attributes.merge 'student_appointments_attributes'=>sa.student_appointments.collect{|std_a|
std_a.attributes.merge 'student_appointment_goals_attributes'=>std_a.student_appointment_goals.collect{|sag|
sag.attributes
}
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment