<commit_before>module Noosfero
  module ActionMailer
    module UrlHelper

      # Set default host automatically if environment is set
      def url_for options = {}
        return super unless options.is_a? Hash
        if (environment rescue nil)
          options[:host] ||= environment.default_hostname
          options[:protocol] ||= environment.default_protocol
        end
        super options
      end

    end
  end
end

class ActionMailer::Base

  attr_accessor :environment

  helper Noosfero::ActionMailer::UrlHelper
<commit_msg>Fix mail urls without protocol<commit_after>module Noosfero
  module ActionMailer
    module UrlHelper

      # Set default host automatically if environment is set
      def url_for options = {}
        return super unless options.is_a? Hash
        if (environment rescue nil)
          options[:host] ||= environment.default_hostname
          # overwrite app/helpers/url_helper.rb
          options[:protocol] = environment.default_protocol
        end
        super options
      end

    end
  end
end

class ActionMailer::Base

  attr_accessor :environment

  helper Noosfero::ActionMailer::UrlHelper

{'fraction_non_alphanumeric': 0.05724197745013009, 'fraction_numerical': 0.0, 'mean_word_length': 2.783606557377049, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5548922', 'n_tokens_mistral': 307, 'n_tokens_neox': 300, 'n_words': 92}