How to get current user

I am trying to filter favourites for the current user in the rails app.

      attribute :user_favorites do { |favorites| favorites.user_id == }.map { |_f| { name: 'favorites' } }

I am getting errors when reindexing.

NameError (undefined local variable or method current_user’ for #Business:0x000056399578a878)`

Is there any option to get replace the device current_user method


Can you give us a little more detail about what you are trying to accomplish? Algolia itself doesn’t have a concept of a user ID. The closest we come is generated userTokens for personalization (Generating userToken | Algolia).

I think this current_user may be coming from your application.