Skip to content

Commit

Permalink
Added validation of member end count
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 15, 2024
1 parent 2ffa3d0 commit 1decd1d
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ OPUmlAbstractAssociationController >> removeModel [
OPUmlAbstractAssociationController >> validate [

super validate.
self validateMemberEndCount.
self model memberEnds do: [ :each | self validateProperty: each ].
self model attributes do: [ :each | self validateProperty: each ]
]

{ #category : 'validation' }
OPUmlAbstractAssociationController >> validateMemberEndCount [

self model memberEnds size = 2 ifTrue: [ ^ self ].

OPModelInvalid signal: (String streamContents: [ :s |
s << self model asString << '" has '
<< self model memberEnds size asString
<< ' memberEnds instead of 2' ])
]

0 comments on commit 1decd1d

Please sign in to comment.