Module: ActiveRecord::Tenanted::Mailer

Defined in:
lib/active_record/tenanted/mailer.rb

Instance Method Summary collapse

Instance Method Details

#url_optionsObject



6
7
8
9
10
11
12
# File 'lib/active_record/tenanted/mailer.rb', line 6

def url_options(...)
  super.tap do |options|
    if ActiveRecord::Tenanted.connection_class && options.key?(:host)
      options[:host] = sprintf(options[:host], tenant: ActiveRecord::Tenanted.connection_class.current_tenant)
    end
  end
end