I have a request table that belongs_to :contact
I want a scope statement in the request.rb file to test if the contact is the current user.
scope :myopen, where(:contact_id => current_user.id)
Returns:
undefined local variable or method `current_user’
What do I use for the current user id?
Thanks
You can’t do this, nor should you. There is no “current” user at the database level.
You need to pass the user object in to a class-level method: