app/models/maestrano/connector/rails/complex_entity.rb in maestrano-connector-rails-0.2.11 vs app/models/maestrano/connector/rails/complex_entity.rb in maestrano-connector-rails-0.2.12

- old
+ new

@@ -57,11 +57,11 @@ if idmap && idmap.last_push_to_external && idmap.last_push_to_external > entity['updated_at'] ConnectorLogger.log('info', organization, "Discard Connec! #{connec_entity_name} : #{entity}") nil else - {entity: sub_entity_instance.map_to(external_entity_name, entity, organization), idmap: idmap || IdMap.create(connec_id: entity['id'], connec_entity: connec_entity_name.downcase, external_entity: external_entity_name.downcase, organization_id: organization.id)} + {entity: sub_entity_instance.map_to(external_entity_name, entity, organization), idmap: idmap || IdMap.create(connec_id: entity['id'], connec_entity: connec_entity_name.downcase, external_entity: external_entity_name.downcase, organization_id: organization.id, name: sub_entity_instance.object_name_from_connec_entity_hash(entity))} end end # ------------------------------------------------------------- # Entity equivalent methods @@ -97,10 +97,10 @@ entities.map!{|entity| idmap = IdMap.find_by(external_id: sub_entity_instance.get_id_from_external_entity_hash(entity), external_entity: external_entity_name.downcase, connec_entity: connec_entity_name.downcase, organization_id: organization.id) # No idmap: creating one, nothing else to do unless idmap - next {entity: sub_entity_instance.map_to(connec_entity_name, entity, organization), idmap: IdMap.create(external_id: sub_entity_instance.get_id_from_external_entity_hash(entity), external_entity: external_entity_name.downcase, connec_entity: connec_entity_name.downcase, organization_id: organization.id)} + next {entity: sub_entity_instance.map_to(connec_entity_name, entity, organization), idmap: IdMap.create(external_id: sub_entity_instance.get_id_from_external_entity_hash(entity), external_entity: external_entity_name.downcase, connec_entity: connec_entity_name.downcase, organization_id: organization.id, name: sub_entity_instance.object_name_from_external_entity_hash(entity))} end # Entity has not been modified since its last push to connec! if idmap.last_push_to_connec && idmap.last_push_to_connec > sub_entity_instance.get_last_update_date_from_external_entity_hash(entity) ConnectorLogger.log('info', organization, "Discard #{@@external_name} #{external_entity_name} : #{entity}") \ No newline at end of file