Monkey patching a gem's controller method

I want to change the keys Devise is using in flash alerts. (Devise uses :notice and :alert flash keys, but I want to change them to :success and :error so that I can display nice green/red boxes with Bootstrap.)

To that end, I want to monkey patch the set_flash_message method in DeviseController.

I created a file called config/initializers/overrides.rb that contains the following:

class DeviseController def set_flash_message(key, kind, options = {})

  if key == 'alert'
    key = 'error'
  elsif key == 'notice'
    key = 'success'
  end
    
  message = find_message(kind, options)
  flash[key] = message if message.present?

end

end

But now I get the following error on any Devise-related action:

Routing Error: undefined method `prepend_before_filter’ for Devise::SessionsController:Class

What am I doing wrong?