Created
December 24, 2009 00:20
-
-
Save edavis10/262928 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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