Hello,
I have the following code in Rails:
@possibleMatchingOffers = SmsOffer.valid.find(:all, :conditions => {:hub_phone_no => unhndledMsg.hub_phone_no})
@matchingContact = @possibleMatchingOffers.biz_sms_reply_queues.valid.find(:all)
The Error I'm getting:
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.each
@possibleMatchingOffers is an array so it's not accepting to use the association (.biz_sms_reply_queues).
I can figure out manual way to do it but I was wondering if there is better easy way to do this.
Thanks,
Tam