[Activesfdc-news] 2nd use of save gives ActiveRecord::StatementInvalid instead of ActiveSalesforce::ASFError

David James davidj503 at gmail.com
Wed Sep 5 11:25:42 EDT 2007


Just wanted to call attention to another bug I've found in ASF:

Somewhat along the lines of my previous email, I'm digging into ASF
and finding that it behaves differently in some ways than
ActiveRecord.

-David



2nd use of save gives ActiveRecord::StatementInvalid instead of
ActiveSalesforce::ASFError

Detailed description

class SfContact < ActiveRecord::Base
  establish_connection :salesforce
  include ActiveSalesforce::ActiveRecord::Mixin
  set_table_name "contact"
end

# script/console

jim = SfContact.new
jim.save
# actual result: ActiveSalesforce::ASFError:
statusCodeREQUIRED_FIELD_MISSINGfieldsLastNamemessageRequired fields
are
missing: [LastName]
# expected result: same (better use of whitespace would be nice, though)

jim.save
# expected result: ActiveSalesforce::ASFError with explanation of
validation failure
# actual result: ActiveRecord::StatementInvalid: NoMethodError: You
have a nil object when you didn't expect it!  You
might have expected an instance of Array.  The error occurred while
evaluating nil.[]: UPDATE contact SET other_postal_code
= NULL, name = NULL, mailing_state = NULL, last_cu_update_date = NULL,
department = NULL, master_record_id = NULL,
mailing_street = NULL, title = NULL, salutation = NULL, other_state =
NULL, mailing_postal_code = NULL, birthdate =
NULL, account_id = NULL, last_activity_date = NULL,
last_modified_by_id = NULL, created_date = NULL, created_by_id =
NULL, assistant_name = NULL, system_modstamp = NULL, mailing_country =
NULL, last_cu_request_date = NULL, description
= NULL, assistant_phone = NULL, phone = NULL, owner_id = NULL,
other_street = NULL, other_country = NULL, home_phone
= NULL, fax = NULL, other_city = NULL, lead_source = NULL,
languages__c = NULL, is_deleted = NULL, first_name = NULL,
reports_to_id = NULL, other_phone = NULL, mailing_city = NULL,
level__c = NULL, last_name = NULL, last_modified_date
= NULL, mobile_phone = NULL, email = NULL WHERE id = ''


More information about the Activesfdc-news mailing list