So that's still a model application and lib is really meant for non-application specific code. I would probably put this file in app/models since it's application specific and it's a model.