Method: Puffer::Extensions::Mapper::InstanceMethods#namespace_with_puffer

Defined in:
lib/puffer/extensions/mapper31.rb

#namespace_with_puffer(path, options = {}) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/puffer/extensions/mapper31.rb', line 43

def namespace_with_puffer path, options = {}
  namespace_without_puffer path, options do
    yield

    if ::Rails.application.routes.resources_tree.any? {|node| node.scope == @scope[:module].to_sym}
      old, @scope[:module] = @scope[:module], 'admin'
      root :to => 'dashboard#index'
      @scope[:module] = old
    end
  end
end