in few places in my code I query db using def results = Domain.findAllBySomething and I expect an array (i use results.size() to determine how many results I have).
However, if findAll call results in a single object returned, it will not be returned as array but a reference to this single object.
Is there any way I could force grails to always return array, no matter how many results there are?
I’m using 2.1.
findAll*is supposed to always return a Collection – I tried the following code in 2.1:prints
Can you add some code that shows it returning a single instance?