Here's my code
project.reports << report
project.save
I want to write a single update command instead of these two lines. Something like
project.update(reports << report)
Is there any possible way to do this?
If you have association like Project has many Reports, then simply using
project.reports << report
will call save too. No need to call project.save seperately.
project.create(report)withhas_many :reportsmapping?project.reports << reportshould save both objects I believe