Patch #33567 » watchers_controller.rb.patch
| trunk/app/controllers/watchers_controller.rb (revision 19811) → trunk/app/controllers/watchers_controller.rb (working copy) | ||
|---|---|---|
| 89 | 89 | |
| 90 | 90 |
def find_project |
| 91 | 91 |
if params[:object_type] && params[:object_id] |
| 92 |
@watchables = find_objets_from_params |
|
| 92 |
@watchables = find_objects_from_params
|
|
| 93 | 93 |
@projects = @watchables.map(&:project).uniq |
| 94 | 94 |
if @projects.size == 1 |
| 95 | 95 |
@project = @projects.first |
| ... | ... | |
| 100 | 100 |
end |
| 101 | 101 | |
| 102 | 102 |
def find_watchables |
| 103 |
@watchables = find_objets_from_params |
|
| 103 |
@watchables = find_objects_from_params
|
|
| 104 | 104 |
unless @watchables.present? |
| 105 | 105 |
render_404 |
| 106 | 106 |
end |
| ... | ... | |
| 133 | 133 |
users |
| 134 | 134 |
end |
| 135 | 135 | |
| 136 |
def find_objets_from_params |
|
| 136 |
def find_objects_from_params
|
|
| 137 | 137 |
klass = Object.const_get(params[:object_type].camelcase) rescue nil |
| 138 | 138 |
return unless klass && klass.respond_to?('watched_by')
|
| 139 | 139 | |