Login  Register

Re: Condition Handling - WIP?

Posted by Sean P. DeNigris on Feb 17, 2018; 4:11pm
URL: https://forum.world.st/Condition-Handling-WIP-tp5066987p5067210.html

Sean P. DeNigris wrote
> 1. The example above only works when using a cached memento. It fails due
> to
> DNU #cache for other Memento types, as well as when validating objects
> directly (e.g. `myDomainObject magritteDescription validate: self.`)

This one was actually a bug/limitation in the example code. Replacing `cache
at:` with `readUsing:`, which is polymorphic among all Memento types and
Object, solves the problem.

So:
```
addCondition: [:memento |
            (memento cache at: self descriptionEndDate) > (memento cache at:
self descriptionStartDate)]
```
becomes
```
addCondition: [:memento |
            (memento readUsing: self descriptionEndDate) > (memento
readUsing:
self descriptionStartDate)]
```



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Magritte-Pier-and-Related-Tools-f115649.html
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.list.inf.unibe.ch/listinfo/smallwiki
Cheers,
Sean