lib/effective_logging/engine.rb in effective_logging-1.0.0 vs lib/effective_logging/engine.rb in effective_logging-1.1.0

- old
+ new

@@ -33,15 +33,12 @@ # This has to be run after initialization or User hasn't been loaded yet config.after_initialize do if EffectiveLogging.user_logins_enabled == true ActiveSupport.on_load :active_record do if defined?(Devise) - User.instance_eval do - alias_method :original_after_database_authentication, :after_database_authentication - define_method(:after_database_authentication) { Effective::UserLogger.successful_login(self) ; original_after_database_authentication() } - end + EffectiveLogging::UserLogger.create_warden_hooks() else - raise ArgumentError.new("EffectiveLogging.user_logins_enabled only works with Devise and a user class defined as User") + raise ArgumentError.new("EffectiveLogging.user_logins_enabled only works with Devise") end end end end