360068 - Add missing associations and dependent - #566
Merged
B-Rass merged 1 commit intoFeb 11, 2026
Merged
Conversation
nicolas-brousse
force-pushed
the
360068-improve-associations-for-delete-confirmations
branch
3 times, most recently
from
January 14, 2026 23:13
beea2c0 to
dea9cd6
Compare
nicolas-brousse
commented
Jan 14, 2026
nicolas-brousse
force-pushed
the
360068-improve-associations-for-delete-confirmations
branch
2 times, most recently
from
February 4, 2026 16:51
59396b8 to
1cb6e44
Compare
nicolas-brousse
marked this pull request as ready for review
February 4, 2026 16:51
B-Rass
requested changes
Feb 5, 2026
| belongs_to :manufacturer, counter_cache: true | ||
| belongs_to :architecture, counter_cache: true | ||
| belongs_to :category, counter_cache: true | ||
|
|
||
| has_many :servers, dependent: :restrict_with_error | ||
| has_many :enclosures, dependent: :destroy |
Collaborator
There was a problem hiding this comment.
Maybe great to give a better display names for enclosure than #<Enclosure:0x0000000127f6a158>
Like Enclosure 1 (1 = position)
| @@ -3,7 +3,7 @@ | |||
| class PortType < ApplicationRecord | |||
| has_changelog | |||
|
|
|||
| has_many :card_types | |||
| has_many :card_types, dependent: :restrict_with_error | |||
Collaborator
There was a problem hiding this comment.
It missing the update of the test for the dependency
B-Rass
requested changes
Feb 5, 2026
| @@ -1,5 +1,4 @@ | |||
| <% | |||
| breadcrumb | |||
| breadcrumb | |||
| @@ -1,5 +1,4 @@ | |||
| <% | |||
| breadcrumb | |||
| breadcrumb | |||
nicolas-brousse
force-pushed
the
360068-improve-associations-for-delete-confirmations
branch
3 times, most recently
from
February 11, 2026 14:22
3121d48 to
3daf2a2
Compare
B-Rass
requested changes
Feb 11, 2026
| def display_name | ||
| composants = object.composants.pluck(:name) | ||
|
|
||
| composants_sentense = if composants.empty? |
Collaborator
There was a problem hiding this comment.
Suggested change
| composants_sentense = if composants.empty? | |
| composants_sentence = if composants.empty? |
| composants.map { |c| c.presence || "n/c" }.to_sentence | ||
| end | ||
|
|
||
| "#{object.class.model_name.human} #{position} (#{composants_sentense})" |
Collaborator
There was a problem hiding this comment.
Suggested change
| "#{object.class.model_name.human} #{position} (#{composants_sentense})" | |
| "#{object.class.model_name.human} #{position} (#{composants_sentence})" |
nicolas-brousse
force-pushed
the
360068-improve-associations-for-delete-confirmations
branch
from
February 11, 2026 14:40
3daf2a2 to
dedd7f9
Compare
B-Rass
approved these changes
Feb 11, 2026
B-Rass
deleted the
360068-improve-associations-for-delete-confirmations
branch
February 11, 2026 14:51
nicolas-brousse
added a commit
to pantographe/my-dcim
that referenced
this pull request
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.