Closed aq closed 8 years ago
Those lines replaced all the attributes of a record during a soft destroy:
class Branche < ActiveRecord::Base include ActiveRecord::SoftDestroyable has_many :sub_branches, foreign_key: 'parent_id', class_name: 'Branche' belongs_to :main_branche, foreign_key: 'parent_id', class_name: 'Branche' end main_branche = Branche.create main_branche.id # => 1 sub_branche = Branche.create parent_id: main_branche.id sub_branche.id # => 2 sub_branche.destroy! sub_branche.id # => ! 1 in place of 2 # because the instance attributes have been replaced.
The spec was a false positive because the relation between hole and location is has_one not has_many:
has_one
has_many
Awesome work! Merging!
I've pushed gem version 4.1.5 with your changes and added your Github username as an author. Thanks, @aq !
Those lines replaced all the attributes of a record during a soft destroy:
The spec was a false positive because the relation between hole and location is
has_one
nothas_many
: