From 52cfe225f706bb5b32a311c580d322126a6bebff Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 6 Feb 2012 16:49:15 +0100 Subject: [PATCH] Support namespaced models for watcher functionality --- app/controllers/watchers_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index e9479f435b..52e2b8b503 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -63,7 +63,7 @@ class WatchersController < ApplicationController private def find_project - klass = Object.const_get(params[:object_type].camelcase) + klass = params[:object_type].camelcase.constantize return false unless klass.respond_to?('watched_by') @watched = klass.find(params[:object_id]) @project = @watched.project