Use the `find_by_user_id` magic finder instead of `where`.
This commit is contained in:
parent
825db23f67
commit
23f9a64566
|
@ -87,7 +87,7 @@ class ProjectsController < ApplicationController
|
||||||
render 'projects/empty'
|
render 'projects/empty'
|
||||||
else
|
else
|
||||||
unless current_user.nil?
|
unless current_user.nil?
|
||||||
@membership = @project.project_members.where(user_id: current_user.id).first
|
@membership = @project.project_members.find_by_user_id(current_user.id)
|
||||||
end
|
end
|
||||||
render :show
|
render :show
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue