Skip to content

Commit

Permalink
Rename metaclass to singleton_class
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlhuda committed Feb 26, 2010
1 parent 8760add commit f863045
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Expand Up @@ -147,7 +147,7 @@ def with_routing
# ROUTES TODO: Figure out this insanity
silence_warnings { ::ActionController.const_set(:UrlFor, @router.named_url_helpers) }
_router = @router
@controller.metaclass.send(:send, :include, @router.named_url_helpers) if @controller
@controller.singleton_class.send(:send, :include, @router.named_url_helpers) if @controller
yield @router
ensure
@router = old_routes
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/caching_test.rb
Expand Up @@ -512,7 +512,7 @@ def reset!
@response = ActionController::TestResponse.new
@controller = ActionCachingTestController.new
# ROUTES TODO: It seems bad to explicitly remix in the class
@controller.metaclass.send(:include, @router.named_url_helpers)
@controller.singleton_class.send(:include, @router.named_url_helpers)
@request.host = 'hostname.com'
end

Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/integration_test.rb
Expand Up @@ -396,7 +396,7 @@ def with_test_route_set
get 'get/:action', :to => controller
end

self.metaclass.send(:include, set.named_url_helpers)
self.singleton_class.send(:include, set.named_url_helpers)

yield
end
Expand Down
4 changes: 2 additions & 2 deletions actionpack/test/controller/resources_test.rb
Expand Up @@ -1231,7 +1231,7 @@ def assert_restful_named_routes_for(controller_name, singular_name = nil, option

@controller = "#{options[:options][:controller].camelize}Controller".constantize.new
# ROUTES TODO: Figure out a way to not extend the routing helpers here
@controller.metaclass.send(:include, @router.named_url_helpers)
@controller.singleton_class.send(:include, @router.named_url_helpers)
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
get :index, options[:options]
Expand Down Expand Up @@ -1301,7 +1301,7 @@ def assert_singleton_routes_for(singleton_name, options = {})
def assert_singleton_named_routes_for(singleton_name, options = {})
(options[:options] ||= {})[:controller] ||= singleton_name.to_s.pluralize
@controller = "#{options[:options][:controller].camelize}Controller".constantize.new
@controller.metaclass.send(:include, @router.named_url_helpers)
@controller.singleton_class.send(:include, @router.named_url_helpers)
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
get :show, options[:options]
Expand Down

0 comments on commit f863045

Please sign in to comment.