Permalink
Browse files

Don't use interpolated strings in where calls.

  • Loading branch information...
1 parent 2659e26 commit b5efbaf9525b94e66a6290739863e3ce0e86df03 @ltw ltw committed Jun 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/game.rb
View
@@ -8,7 +8,7 @@ class Game < ActiveRecord::Base
validates :winner_score, :loser_score, :presence => true
validates :played_date, :presence => true
- scope :for_user, lambda { |user| where("winner_id = #{user.id} OR loser_id = #{user.id}") }
+ scope :for_user, lambda { |user| where('winner_id = :user_id OR loser_id = :user_id', user_id: user.id) }
def self.parse phrase
GameCreator.new Parser.parse(phrase)

0 comments on commit b5efbaf

Please sign in to comment.