ruby on rails - Saving modified collection of records into instance variable -


i have collection of objects being pulled third party service. using each_with_index block iterate on them , make changes 1 of attributes in each object (payment_due_date__c). i'd have these records saved new instance variable can pass view , iterate on inside table.

@payments.each_with_index |x, i|     loan_start_plus = @loan_start_date + i.months     x.payment_due_date__c = 3.business_days.before(loan_start_plus) end 

how can save updated records collection can pass view?

maybe help:

@payments.each_with_index.map |x, i|     loan_start_plus = @loan_start_date + i.months     x.payment_due_date__c = 3.business_days.before(loan_start_plus) end 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -