I have a module with a function. It resides in /lib/contact.rb:
module Contact class << self def run(current_user) ... end end end >
Delegation to url_helpers seems much better than including the whole module into your model
delegate :url_helpers, to: 'Rails.application.routes' url_helpers.users_url => 'www.foo.com/users'
reference