Skip to content

Instantly share code, notes, and snippets.

@Electron-libre
Created May 18, 2011 12:12
Show Gist options
  • Save Electron-libre/978462 to your computer and use it in GitHub Desktop.
Save Electron-libre/978462 to your computer and use it in GitHub Desktop.
devise.rb
module HectorFetch
module InstanceMethods
def service_with_fetch
res = service_without_fetch
logger.info("in with_fetch #{current_user}")
current_user.update_from_hector
res
end
end
def self.included(base)
base.class_eval do
include InstanceMethods
alias_method_chain :service, :fetch
end
end
end
Taxman::Application.config.after_initialize do
class Devise::CasSessionsController
include HectorFetch
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment