diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/mail_handler.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 007df6f2d..1364fdb97 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -29,11 +29,11 @@ class MailHandler < ActionMailer::Base options[:issue] ||= {} + options[:allow_override] ||= [] if options[:allow_override].is_a?(String) - options[:allow_override] = options[:allow_override].split(',').collect(&:strip) + options[:allow_override] = options[:allow_override].split(',') end - options[:allow_override] ||= [] - options[:allow_override].map!(&:downcase) + options[:allow_override].map! {|s| s.strip.downcase.gsub(/\s+/, '_')} # Project needs to be overridable if not specified options[:allow_override] << 'project' unless options[:issue].has_key?(:project) @@ -327,8 +327,11 @@ class MailHandler < ActionMailer::Base @keywords[attr] else @keywords[attr] = begin - if (options[:override] || handler_options[:allow_override].include?(attr.to_s.downcase)) && - (v = extract_keyword!(cleaned_up_text_body, attr, options[:format])) + override = options.key?(:override) ? + options[:override] : + (handler_options[:allow_override] & [attr.to_s.downcase.gsub(/\s+/, '_'), 'all']).present? + + if override && (v = extract_keyword!(cleaned_up_text_body, attr, options[:format])) v elsif !handler_options[:issue][attr].blank? handler_options[:issue][attr] |