|
|
|
@ -309,7 +309,14 @@ class ApplicationController < ActionController::Base |
|
|
|
|
rescue ActiveRecord::RecordNotFound |
|
|
|
|
render_404 |
|
|
|
|
end |
|
|
|
|
alias :find_project_by_project_id :find_project |
|
|
|
|
|
|
|
|
|
# Find project of id params[:project_id] |
|
|
|
|
# Note: find() is Project.friendly.find() |
|
|
|
|
def find_project_by_project_id |
|
|
|
|
@project = Project.find(params[:project_id]) |
|
|
|
|
rescue ActiveRecord::RecordNotFound |
|
|
|
|
render_404 |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# Find a project based on params[:project_id] |
|
|
|
|
# TODO: some subclasses override this, see about merging their logic |
|
|
|
@ -354,7 +361,7 @@ class ApplicationController < ActionController::Base |
|
|
|
|
@project = instance.project |
|
|
|
|
instance_variable_set('@' + model_object.to_s.underscore, instance) |
|
|
|
|
else |
|
|
|
|
@project = Project.friendly.find(params[:project_id]) |
|
|
|
|
@project = Project.find(params[:project_id]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
rescue ActiveRecord::RecordNotFound |
|
|
|
|