In my domain class User I would like to have boolean flag active. Is there any way to override methods like User.findAll
and User.findAllBy
... by adding condition active == true
?
What I want to achieve is calling User.findAll
means find all users where active is true, and calling dynamic method like User.findAllByName('mike')
will return all users with name mike and active flag set to true.
My grails version is 3.0.3