Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this SQL statement vulnerable to SQL injection?

My index action is

def index
  @users = User.without_user(current_user)
end

where without_user is a scope

scope :without_user, lambda {|user| where("id <> :id", :id => user.id) }

I was wondering if this is the most secure way to implement this or is it vulnerable ?

like image 604
Ahmad Al-kheat Avatar asked Jul 19 '26 07:07

Ahmad Al-kheat


1 Answers

looks fine. If the data is interpolated then it should be safe which looks like the case here.

like image 166
AshwinKumarS Avatar answered Jul 21 '26 22:07

AshwinKumarS