cirandas.net

ref: master

config/initializers/noosfero_urls.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
if Rails.env == 'development'
  ActionController::Base.send(:prepend_before_filter) do |controller|
    # XXX note that this is not thread-safe! Accessing a Noosfero instance in
    # development mode under different ports concurrently _will_ lead to weird
    # things happening.
    if [80,443].include?(controller.request.port)
      url_options = {}
    else
      url_options = { :port => controller.request.port }
    end
    Noosfero.instance_variable_set('@development_url_options', url_options)
  end
end