I want to check that the list contains a specific string.
before checking all entries in the list, as well as bite in lower case
I tried like this
def venueName = params.name def venueNameLists = Venue.executeQuery("select name from Venue") if(venueNameLists.toLowerCase().contains(venueName.toLowerCase())){ error = true; log.debug("save :: duplicate name") flash.message = "Venue name already exist"; render(view: "create", model: [venueInstance: new Venue(params)]) return }
gives an error
No signature of method: java.util.ArrayList.toLowerCase() is applicable for argument types: () values: []. Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.toLowerCase() is applicable for argument types: () values: []
source share