class Recovery < ActiveRecord::Base def self.processrecovery @members = Member.where(record_status: "1") @members.each do |member| tmemberCode = member.member_code : : :# Processing of data from different database : : *# Variables containing processed data* interest_to_be_paid pInstallmentAmt = tPersonalLoanBalAmt * tpersonalintrate / (100 * 12) jInstallmentAmt = tJointLoanBalAmt * tjointintrate / (100 * 12) end end
Now how can I insert these processed data into recoveries table? Should I user Recovery.create(interest: => interest_to_be_paid, p_installement: => pInstallmentAmt,.....) inside recovery.rb (model) itself? -- 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+unsubscr...@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/f7ad5eb5-1760-4748-b84c-b398fdf8cedd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.