Patch #33329 » 0001-Fix-typo-in-find_objects_from_params.patch
| app/controllers/watchers_controller.rb | ||
|---|---|---|
| 91 | 91 | |
| 92 | 92 |
def find_project |
| 93 | 93 |
if params[:object_type] && params[:object_id] |
| 94 |
@watchables = find_objets_from_params |
|
| 94 |
@watchables = find_objects_from_params
|
|
| 95 | 95 |
@projects = @watchables.map(&:project).uniq |
| 96 | 96 |
if @projects.size == 1 |
| 97 | 97 |
@project = @projects.first |
| ... | ... | |
| 102 | 102 |
end |
| 103 | 103 | |
| 104 | 104 |
def find_watchables |
| 105 |
@watchables = find_objets_from_params |
|
| 105 |
@watchables = find_objects_from_params
|
|
| 106 | 106 |
unless @watchables.present? |
| 107 | 107 |
render_404 |
| 108 | 108 |
end |
| ... | ... | |
| 138 | 138 |
users |
| 139 | 139 |
end |
| 140 | 140 | |
| 141 |
def find_objets_from_params |
|
| 141 |
def find_objects_from_params
|
|
| 142 | 142 |
klass = Object.const_get(params[:object_type].camelcase) rescue nil |
| 143 | 143 |
return unless klass && klass.respond_to?('watched_by')
|
| 144 | 144 | |