Ruby on Rails Wednesday, April 20, 2016

On 20 April 2016 at 13:46, Elton Santos <elton.melo.santos@gmail.com> wrote:
> Hey Colin!! Finally!!! FINALLY!!!! LOOK:
>
> I just add this:
>
>>
>>
>> auth_params[:contract_number].zip(auth_params[:value_solve].reject(&:blank?)).each
>> do |contract_number, value_solve|
>> Authorization.where(contract_number:
>> contract_number).update_all(value_solve: value_solve, situation: 2)
>> end

Why are you using update_all? You realise it doesn't run ActiveRecord
callbacks or validations.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvdbB7iSarWZGPggmcJBy0Ob%3DyLUQMOOTsjROALHwdhyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment