Fix invalid find_project_by_project_id

pull/4862/head
Oliver Günther 8 years ago
parent 7994631440
commit 8c42f5ae35
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 11
      app/controllers/application_controller.rb

@ -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

Loading…
Cancel
Save