chicks / sugarcrm

A ruby based REST Client for SugarCRM
MIT License
90 stars 64 forks source link

Multiple Employee/User Records Being Returned When Single Is Expected #116

Open StrangeWill opened 8 years ago

StrangeWill commented 8 years ago

Was prototyping some automation using this gem and ran into a weird issue:

[29] pry(main)> ::SugarCRM::User.all(conditions: { user_name: "StrangeWill" }).count                           
=> 1128

Query also takes like a couple minutes. It's running on SugarCRM's cloud, really odd, it's like it's pulling a record for every related record to the user (call, lead, opportunity, etc).

Same result on the SugarCRM.connection.get_entry_list call.

Ideally I'd like to do a User.all(conditions: { user_name: "= 'a' OR 'b' OR 'c' }) type setup. may just end up doing multiple User.firsts and looking up each user individually.

chicks commented 8 years ago

Since the gem just wraps the REST API, this issue is most likely on the Sugar server. If you turn on debug, you can peek at what we are sending.

Enable debugging on the current connection

SugarCRM.connection.debug = true