NoMethodError: undefined method `klass' for false:FalseClass
Got this error when trying to retrieve Contacts from a SugarCRM installation. I'm pretty clueless about this because it seems to work in every other installation I've tried before.
Pretty standard SugarCRM::Contact.all after SugarCRM.connect(...)
NoMethodError: undefined method `klass' for false:FalseClass
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/association.rb:81:in `resolve_target'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/association.rb:25:in `initialize'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/associations.rb:9:in `new'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/associations.rb:9:in `block in register'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/associations.rb:8:in `each_key'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/associations.rb:8:in `register'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/associations/association_methods.rb:63:in `define_association_methods'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/base.rb:141:in `initialize'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/base.rb:34:in `new'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/base.rb:34:in `find'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/sugarcrm-0.9.18/lib/sugarcrm/base.rb:96:in `all'
from (irb):26
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/padrino-core-0.10.7/lib/padrino-core/cli/base.rb:68:in `console'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:109:in `invoke'
from /Users/tiago/.rvm/gems/ruby-1.9.3-p194/gems/padrino-core-0.10.7/lib/padrino-core/cli/base.rb:73:in `c
Hrm... looks like it's choking on resolving an association to the Contacts module. Check that the relationships to Contacts are all okay in Sugar studio.
Unfortunately I have no control of the SugarCRM installation where this is happening as I develop a piece of software that must work with third-party SugarCRM accounts.
But I was able to avoid this error but checking on the module_name result value. Hope this helps :)
Even better! Thanks again!
I have the same problem for this line userAssignedSugar = SugarCRM::User.find_by_first_name_and_last_name(userAssigned.firstname.capitalize, userAssigned.lastname.upcase)
I don't understand how tjsousa resolve this issue. You can help me ?
I have that too for Account.
When I try to access Accounts module, it shows an error "undefined method `klass' for false:FalseCla ss (NoMethodError)" somebody plz help me. Thanks in advance