On Monday, August 22, 2016 at 1:55:39 PM UTC-7, [email protected] wrote:
>
>
>
>>     errors.add(:sales_qty, "Not filled in") if !draft? && && (!sales_line 
>> || !sales_line['sales_qty'])
>>     errors.add(:approve_qty, "Not filled in") if approved? && 
>> (!sales_line || !sales_line['approved_qty'])
>>
>>
> This solution works if the serialized data is singular, meaning there is 
> only one record. If it's an array of data though, I receive the error 
> `TypeError: no implicit conversion of Symbol into Integer`
>

Then you probably want to change the condition to something like: 
!sales_lines.empty? && sales_lines.all?{|sl| sl['sales_qty']} 

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to