Use the `find_by_user_id` magic finder instead of `where`.

This commit is contained in:
Patricio Cano 2015-09-16 21:02:40 -05:00
parent 825db23f67
commit 23f9a64566
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ class ProjectsController < ApplicationController
render 'projects/empty'
else
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
render :show
end