Skip to content

Commit 9e0249f

Browse files
committed
two-way link fixes
1 parent a4ca8cf commit 9e0249f

7 files changed

+7
-7
lines changed

app/models/page_groupers/group_allyship.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class GroupAllyship < ApplicationRecord
1515
this_object = Group.find_by(id: self.group_id)
1616
other_object = Group.find_by(id: self.ally_id)
1717

18-
other_object.allies.delete this_object
18+
other_object.allies.delete(this_object) if other_object.present?
1919
end
2020
end

app/models/page_groupers/group_enemyship.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class GroupEnemyship < ApplicationRecord
1515
this_object = Group.find_by(id: self.group_id)
1616
other_object = Group.find_by(id: self.enemy_id)
1717

18-
other_object.enemies.delete this_object
18+
other_object.enemies.delete(this_object) if other_object.present?
1919
end
2020
end

app/models/page_groupers/sistergroupship.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class Sistergroupship < ApplicationRecord
1515
this_object = Group.find_by(id: self.group_id)
1616
other_object = Group.find_by(id: self.sistergroup_id)
1717

18-
other_object.sistergroups.delete this_object
18+
other_object.sistergroups.delete(this_object) if other_object.present?
1919
end
2020
end

app/models/page_groupers/subgroupship.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ class Subgroupship < ApplicationRecord
1818
this_object = Group.find_by(id: self.group_id)
1919
other_object = Group.find_by(id: self.subgroup_id)
2020

21-
other_object.supergroups.delete(this_object)
21+
other_object.supergroups.delete(this_object) if other_object.present?
2222
end
2323
end

app/models/page_groupers/technology_child_technology.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ class TechnologyChildTechnology < ApplicationRecord
2020
this_object = Technology.find_by(id: self.technology_id)
2121
other_object = Technology.find_by(id: self.child_technology_id)
2222

23-
other_object.parent_technologies.delete(this_object)
23+
other_object.parent_technologies.delete(this_object) if other_object.present?
2424
end
2525
end

app/models/page_groupers/technology_parent_technology.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ class TechnologyParentTechnology < ApplicationRecord
2020
this_object = Technology.find_by(id: self.technology_id)
2121
other_object = Technology.find_by(id: self.parent_technology_id)
2222

23-
other_object.child_technologies.delete(this_object)
23+
other_object.child_technologies.delete(this_object) if other_object.present?
2424
end
2525
end

app/models/page_groupers/technology_related_technology.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class TechnologyRelatedTechnology < ApplicationRecord
1414
this_object = Technology.find_by(id: self.technology_id)
1515
other_object = Technology.find_by(id: self.related_technology_id)
1616

17-
other_object.related_technologies.delete(this_object)
17+
other_object.related_technologies.delete(this_object) if other_object.present?
1818
end
1919
end

0 commit comments

Comments
 (0)