Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T torque-postgresql
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Carlos
  • torque-postgresql
  • Issues
  • #43
Closed
Open
Issue created Feb 03, 2020 by Administrator@rootContributor

Error trying to associate records to a new model

Created by: smarquez1

When I try to associate records to a new mode, I get the following ActiveRecord error:

> tag = FactoryBot.create(:tag)
> Video.new tags: [tag]

 ActiveRecord::ActiveRecordError:
       cannot update a new record

I think that the following line is the culprit, since it tries to update the record without knowing if it's already persisted: https://github.com/crashtech/torque-postgresql/blob/master/lib/torque/postgresql/associations/belongs_to_many_association.rb#L36

Assignee
Assign to
Time tracking