chicks / sugarcrm

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

Dynamic Finder Match is broken in ruby 1.8.7 #26

Closed chicks closed 13 years ago

chicks commented 13 years ago

Just ran unit tests against HEAD. When using Dynamic Finders to search Users, the result returned is always the admin or currently logged in user. This works as expected in ruby 1.9.2

1.8.7: SugarCRM::User.find_by_first_name("Test")

<SugarCRM::User user_name: "admin", accept_status_id: nil, accept_status_name: nil, address_city: "", address_country: "", address_postalcode: "", address_state: "", address_street: "", authenticate_id: "", c_accept_status_fields: " ...", created_by: "", created_by_name: "", date_entered: "2011-01-29 01:20:08", date_modified: "2011-01-29 01:47:40", deleted: false, department: "", description: "", email1: "awesome@awesome.com", employee_status: "Active", external_auth_only: false, first_name: "", full_name: nil, id: "1", is_admin: true, is_group: false, last_name: "Administrator", m_accept_status_fields: " ...", messenger_id: "", messenger_type: "", modified_by_name: "", modified_user_id: "1", name: nil, phone_fax: "", phone_home: "", phone_mobile: "", phone_other: "", phone_work: "", portal_only: false, pwd_last_changed: "", receive_notifications: false, reports_to_id: "", reports_to_name: "", status: "Active", sugar_login: true, system_generated_password: false, title: "Me", user_hash: "0d107d09f5bbe40cade3de5c71e9e9b7">

1.9.2: SugarCRM::User.find_by_first_name("Test")

<SugarCRM::User user_name: "test_user", accept_status_id: nil, accept_status_name: nil, address_city: "", address_country: "", address_postalcode: "", address_state: "", address_street: "", authenticate_id: "", c_accept_status_fields: " ...", created_by: "1", created_by_name: "", date_entered: "2011-01-29 01:40:20", date_modified: "2011-01-29 01:40:20", deleted: false, department: "", description: "", email1: "abc@abc.com", employee_status: "", external_auth_only: false, first_name: "Test", full_name: nil, id: "336b9088-9f3a-feab-1303-4d4370d19b24", is_admin: false, is_group: false, last_name: "User", m_accept_status_fields: " ...", messenger_id: "", messenger_type: "", modified_by_name: "", modified_user_id: "1", name: nil, phone_fax: "", phone_home: "", phone_mobile: "", phone_other: "", phone_work: "", portal_only: false, pwd_last_changed: "", receive_notifications: true, reports_to_id: "", reports_to_name: "", status: "Active", sugar_login: true, system_generated_password: false, title: "", user_hash: "">

davidsulc commented 13 years ago

Very weird: it seems the file hasn't been touched since Nov 14th...

And nearly all Base.method_missing? hasn't been touched either since that day.

Best guess, it's due to commit https://github.com/chicks/sugarcrm/commit/a627b2414ff02b76d8eff14cfc3bbb558bd7087f

chicks commented 13 years ago

Yeah, I have no idea why it's occurring. I'll figure it out though! :)

davidsulc commented 13 years ago

I think I broke it due to an oversight in https://github.com/chicks/sugarcrm/commit/86b5ea1a20ff3f0bdef3b813603e89cd8248b5cc

should be fixed with https://github.com/chicks/sugarcrm/commit/38700be43b152883d5d17bd67f4efa743e511ab1

Tested with both 1.8.7 and 1.9.2.

Can you confirm?

chicks commented 13 years ago

Fixed!