From e161717f73b7b9f79419b4776315743a650cca9a Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 17 Nov 2015 11:48:29 +0100 Subject: [PATCH] Simplify pusher handling in store --- app/services/store.coffee | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/services/store.coffee b/app/services/store.coffee index 2ed7cdb2..3b83016c 100644 --- a/app/services/store.coffee +++ b/app/services/store.coffee @@ -74,14 +74,12 @@ Store = DS.Store.extend job = @recordForId('job', data.id) job.appendLog(number: parseInt(data.number), content: data._log, final: data.final) else if data[name] - @_loadOne(name, data) + @loadOne(name, data) else throw "can't load data for #{name}" unless type - _loadOne: (type, json) -> - payload = {} - payload[type.pluralize()] = [json[type]] - @push(this.normalize(type, json)) + loadOne: (type, json) -> + record = @push(this.normalize(type, json)) # we get other types of records only in a few situations and # it's not always needed to update data, so I'm specyfing which