update User model to use lambda to specify uniquness of results from ActiveRecord associations