When an ActiveRecord model has more than one belongs_to
association, calling delete_all
on an ActiveRecord::Associations::CollectionProxy
will not delete the records but unassociate them. That might be a problem in a table with a NOT NULL
clause.
Client.create
# => #<Client id: 1, created_at: "2013-08-14 17:43:42", updated_at: "2013-08-14 17:43:42">
Team.create
# => #<Team id: 1, created_at: "2013-08-14 17:43:55", updated_at: "2013-08-14 17:43:55">