title: syntax error, unexpected tCONSTANT
body: <p>Can any one explain me what's my problem :</p>
  
  <pre><code>ActiveRecord::Base.connection.select_values('SELECT c.value FROM custom_values c,
  time_entries p, custom_fields cf  where  c.customized_type = 'TimeEntry' 
  and p.id = c.customized_id and c.custom_field_id = cf.id 
  and cf.type = 'TimeEntryCustomField' and cf.name = 'Reference TS Client' 
  and p.id = '+ log.user.id.to_s +' ;')
  </code></pre>
  
  <p>I get this error just for "c.customized_type". What can be the issue?</p>