mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-08 21:07:08 +10:00
Fix the issue of to say if current user followed someone.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user