Fixed #15288 Define find_by_* methods in anonymous module