Created
January 23, 2018 11:20
-
-
Save eidge/b4f4649cfc1cba293589b9bf1c45955f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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