Fix the issue of to say if current user followed someone.

This commit is contained in:
2015-10-26 23:47:15 +08:00
parent c7da19cd64
commit f618ca2373
2 changed files with 3 additions and 1 deletions
@@ -1,6 +1,8 @@
class Api::V1::UsersController < Api::V1::ApplicationController
skip_before_action :authenticate_user_from_token, only: [:show]
before_action :fetch_current_user, only: [:show]
before_action :load_user, except: [:me, :search]
def show
+1 -1
View File
@@ -5,7 +5,7 @@ class UserSerializer < ActiveModel::Serializer
def followed
return true if object == scope.current_user
object.followers_ids.include? scope.current_user
object.followers_ids.include? scope.current_user.try(:id)
end
def posts_count