阅读背景:

在ActiveRecord中使用准备好的语句是不可能的。

来源:互联网 

I'm writing a complex ActiveRecord query that passes an ActivRecord::Relation in a pipeline of filtering functions. One of them has to add a sequence of "OR" linked conditions. As ActiveRecord::Relation does not provide the #or method I'm writing an SQL string to pass into #where. This string is generated dynamically, so I can't really use ? for values. I know from previous questions that using prepared statements is the best practice method of creating queries, but I can't find a way to apply it here.I'm writing a complex ActiveRecord query that p




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: