Skip to content

Commit 0429bd7

Browse files
committed
better way to compute derive properties
1 parent 839b7f9 commit 0429bd7

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

src/Fame-Core/FMRelationSlot.class.st

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -168,27 +168,21 @@ FMRelationSlot >> moosePropertyDictionary [
168168

169169
{ #category : #internal }
170170
FMRelationSlot >> moosePropertyFor: anOwningClassName multivalued: aBoolean [
171-
172171
| mooseProperty needsToBeSet |
173-
174172
needsToBeSet := false.
175-
176-
mooseProperty := self moosePropertyDictionary at: anOwningClassName ifAbsentPut: [
177-
needsToBeSet := true.
178-
FM3PropertyDescription new ].
179-
180-
needsToBeSet ifTrue: [
181-
mooseProperty name: self name asString.
182-
mooseProperty setImplementingSelector: self name. "should be a link to slot"
183-
184-
mooseProperty isMultivalued: aBoolean.
185-
mooseProperty isDerived: true.
186-
187-
mooseProperty privOpposite: self inverseSlot mooseProperty ].
188-
189-
^ mooseProperty.
190-
191-
173+
mooseProperty := self moosePropertyDictionary
174+
at: anOwningClassName
175+
ifAbsentPut: [ needsToBeSet := true.
176+
FM3PropertyDescription new ].
177+
needsToBeSet
178+
ifTrue: [ mooseProperty name: self name asString.
179+
mooseProperty setImplementingSelector: self name. "should be a link to slot"
180+
mooseProperty isMultivalued: aBoolean.
181+
(Pragma
182+
inMethod: (self class environment at: anOwningClassName) >> self name
183+
named: #derived) ifNotNil: [ mooseProperty isDerived: true ].
184+
mooseProperty privOpposite: self inverseSlot mooseProperty ].
185+
^ mooseProperty
192186
]
193187

194188
{ #category : #printing }

0 commit comments

Comments
 (0)