On Wed, Apr 29, 2015 at 9:08 AM, Padmahas Bn <padmahas@gmail.com> wrote:
> I mean that I'm not using association between tables when it is possible to
> easily cascade changes done in one table,
I'm afraid I don't understand that sentence,
> And I've not seen anywhere inserting records through model directly
?? From your original example:
class Recovery < ActiveRecord::Base
def self.processrecovery
# do whatever
create(interest: interest_to_be_paid, p_installment: pInstallmentAmt)
end
end
And there you go, you've created a new Recovery object and saved
it to the database.
Try thinking less in terms of "tables" and more in terms of "objects"
and let ActiveRecord do its job as ORM :-)
FWIW,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote
--
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/CACmC4yBJhSzM%3D1XhXiZ9O6XDJacZ_gz%3DVjwAdw71ojSvSjRXhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment