现在的位置: 首页 > 综合 > 正文

ruby::conditions => “LIKE ___%” syntax

2014年02月19日 ⁄ 综合 ⁄ 共 268字 ⁄ 字号 评论关闭

The following gives an error: ArgumentError:
malformed format string - %'
:

 named_scope :sales, :conditions => ["rolename LIKE 'salesteam%'"]

The following is OK:

 named_scope :sales, :conditions => ["rolename LIKE 'salesteam%%'"]

I am wondering where I can find the documentation for the %% (double
%) syntax.

抱歉!评论已关闭.