mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-02-13 09:13:58 -05:00
fixed entity, they need strings
This commit is contained in:
@@ -92,10 +92,10 @@ class QboController < ApplicationController
|
|||||||
data = params.as_json
|
data = params.as_json
|
||||||
end
|
end
|
||||||
# Process the information
|
# Process the information
|
||||||
entities = data['eventNotifications'][0]['dataChangeEvent'][:entities]
|
entities = data['eventNotifications'][0]['dataChangeEvent']['entities']
|
||||||
entities.each do |entity|
|
entities.each do |entity|
|
||||||
id = entity[:id].to_i
|
id = entity['id'].to_i
|
||||||
name = entity[:name]
|
name = entity['name']
|
||||||
|
|
||||||
logger.info "Casting #{name.constantize} to obj"
|
logger.info "Casting #{name.constantize} to obj"
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ class QboController < ApplicationController
|
|||||||
obj.destroy(entity['deletedId']) if entity['deletedId']
|
obj.destroy(entity['deletedId']) if entity['deletedId']
|
||||||
|
|
||||||
#Check to see if we are deleting a record
|
#Check to see if we are deleting a record
|
||||||
if entity[:operation].eql? "Delete"
|
if entity['operation'].eql? "Delete"
|
||||||
obj.destroy(id)
|
obj.destroy(id)
|
||||||
#if not then update!
|
#if not then update!
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user