Closed philfriesen closed 10 years ago
Gah, I thought I'd checked that before putting it in. Thanks for catching that. I need to go over chapter 5 again anyway, so I'll revisit this and perhaps use a different example.
I changed to using dateCreated
for the example. Interestingly, I can no longer see a ClassCastException
- I get a ConversionFailedException
instead. I have a note to check the behaviour for whatever version of Grails we eventually plump for in the book. At this rate, could be Grails 2.4, but more likely 2.3.
The book says that when the following code is run as a script in the console:
we should see a ClassCastException because loginId is a String property and 12 is not a String.
Actually, the integer is automatically converted to a String so no ClassCastException is thrown. I verified this by adding the following code to Bootstrap.groovy:
and changing the console script to:
The script results were: