Sanitize sql query for ActiveRecord::Base#can_rate? method