<>proBLEM>:
我想提出一个问题,这将引发类似的东西。
select * from users where code in (1,2,4);
缩略语
www.un.org/Depts/DGACM/index_spanish.htm WHAT I TRIED:
这是一部单一的法典:
named_scope :of_code, lambda {|code| {:conditions => ["code = ?", code]}}
我尝试过这样的事情。
named_scope :of_codes, lambda {|codes| {:conditions => ["code in ?", codes]}}
送交
user.of_codes( (1,2,4) )
it triggers
select * from users where code in (1,2,4)
which raises a MySQL error because of the extra quotes.
<PS:Ideally I 我想 送<>code>user.of_codes ([1,2,4]