@report = current_account.reports.new(report_params)
@report.name.try(:strip!)
@report.report_type = "campaign"
@report.save
Reports has_and_belongs_to_many contacts and vice versa When we have approximately 7000 contacts ids, the insert query gets slow and the request times out. We cannot increase the time out because it's not the solution. I have studied the activerecord-import library but I am not very sure about it. Is there any rails way to make this insertion/creation fast. We cannot put this in a job as it must be in realtime.