Skip to content

Instantly share code, notes, and snippets.

@eidge
Created January 23, 2018 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eidge/b4f4649cfc1cba293589b9bf1c45955f to your computer and use it in GitHub Desktop.
Save eidge/b4f4649cfc1cba293589b9bf1c45955f to your computer and use it in GitHub Desktop.
let(:resources_hash) do
{
interactions: {
create: [{
uuid: 'this-is-a-uuid',
service_id: Service.first.id,
manual_alarm_state: 'ok',
finish_at: Time.zone.now,
responsible_person_ids: [carer.id]
},
create: {
uuid: 'this-is-a-uuid',
service_id: Service.first.id,
manual_alarm_state: 'ok',
finish_at: Time.zone.now,
responsible_person_ids: [carer.id]
}],
update: [{
uuid: 'this-is-a-uuid',
finish_at: '2018/02/01'
}]
}
}
end
=================================
Appointment.afterCreate() do
SyncRequest.append(:create, self)
end
Appointment.afterUpdate() do
SyncRequest.append(:create, self)
end
Appointment.afterDelete() do
SyncRequest.append(:create, self)
end
# Every 10 mins
SyncRequest.pending.upload_to_nourish
# 20mins worth of changes
===========================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment