Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created December 24, 2009 00:20
Show Gist options
  • Save edavis10/262928 to your computer and use it in GitHub Desktop.
Save edavis10/262928 to your computer and use it in GitHub Desktop.
module EventNotificationOverride
module Patches
module UserPreferencePatch
def self.included(base)
base.class_eval do
define_method '[]_with_override' do |attr_name|
if attr_name.to_sym == :no_self_notified &&
Setting.plugin_redmine_event_notification_override['enabled'].to_s == '1'
return Setting.plugin_redmine_event_notification_override['notify_users_of_their_own_changes'] != 'all'
else
send('[]_without_override', attr_name)
end
end
alias_method_chain :[], :override
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment