aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-10-09 20:59:20 +0200
committerPiotr Sarnacki <drogus@gmail.com>2010-10-09 21:32:34 +0200
commit5d5eb2b18d364cb27d2062668bd3b1921b1040a8 (patch)
tree519a7e779a9e914d183c9851a63f9ef8333a5d2b /railties/lib/rails
parentafd76d7fe9bb5e1b90a3b1c75abe45488e871f72 (diff)
downloadrails-5d5eb2b18d364cb27d2062668bd3b1921b1040a8.tar.gz
rails-5d5eb2b18d364cb27d2062668bd3b1921b1040a8.tar.bz2
rails-5d5eb2b18d364cb27d2062668bd3b1921b1040a8.zip
Rename namespace method to isolate_namespace.
This change caused by confusion caused by calling engine "namespaced". Stuff inside engine can be namespaced for every engine. This method is not actually namespacing anything, it's isolating engine within the given namespace.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/engine.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index f8caaef213..909840da04 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -214,11 +214,11 @@ module Rails
# as they would be created inside application. One of the cosequences of that is including
# application's helpers and url_helpers inside controller. Sometimes, especially when your
# engine provides its own routes, you don't want that. To isolate engine's stuff from application
- # you can use namespace method:
+ # you can use isolate_namespace method:
#
# module MyEngine
# class Engine < Rails::Engine
- # namespace MyEngine
+ # isolate_namespace MyEngine
# end
# end
#
@@ -252,7 +252,7 @@ module Rails
# end
#
#
- # Additionaly namespaced engine will set its name according to namespace, so in that case:
+ # Additionaly isolated engine will set its name according to namespace, so in that case:
# MyEngine::Engine.engine_name #=> "my_engine" and it will set MyEngine.table_name_prefix
# to "my_engine_".
#
@@ -315,7 +315,7 @@ module Rails
autoload :Configuration, "rails/engine/configuration"
class << self
- attr_accessor :called_from, :namespaced
+ attr_accessor :called_from, :isolated
alias :engine_name :railtie_name
def inherited(base)
@@ -350,12 +350,12 @@ module Rails
@endpoint
end
- def namespace(mod)
+ def isolate_namespace(mod)
engine_name(generate_railtie_name(mod))
name = engine_name
self.routes.default_scope = {:module => name}
- self.namespaced = true
+ self.isolated = true
unless mod.respond_to?(:_railtie)
_railtie = self
@@ -371,13 +371,13 @@ module Rails
end
end
- def namespaced?
- !!namespaced
+ def isolated?
+ !!isolated
end
end
delegate :middleware, :root, :paths, :to => :config
- delegate :engine_name, :namespaced?, :to => "self.class"
+ delegate :engine_name, :isolated?, :to => "self.class"
def load_tasks
super
@@ -506,7 +506,7 @@ module Rails
end
initializer :prepend_helpers_path do |app|
- if !namespaced? || (app == self)
+ if !isolated? || (app == self)
app.config.helpers_paths.unshift(*paths["app/helpers"].existent)
end
end