mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Rename isolated_engine_for to namespace
This commit is contained in:
@@ -200,11 +200,11 @@ module Rails
|
||||
@endpoint
|
||||
end
|
||||
|
||||
def isolated_engine_for(mod)
|
||||
_engine = self
|
||||
def namespace(mod)
|
||||
_railtie = self
|
||||
mod.singleton_class.instance_eval do
|
||||
define_method(:_railtie) do
|
||||
_engine
|
||||
_railtie
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -338,11 +338,11 @@ module RailtiesTest
|
||||
assert_equal "/foo", response[2].body
|
||||
end
|
||||
|
||||
test "isolated engine should include only its own routes and helpers" do
|
||||
test "namespaced engine should include only its own routes and helpers" do
|
||||
@plugin.write "lib/bukkits.rb", <<-RUBY
|
||||
module Bukkits
|
||||
class Engine < ::Rails::Engine
|
||||
isolated_engine_for Bukkits
|
||||
namespace Bukkits
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
|
||||
Reference in New Issue
Block a user