阅读背景:

是否有一种方法来判断一个记录在使用find_or_create_by创建后是否为新的

来源:互联网 

I'm using this code:

我用这段代码:

item = Item.find_or_create_by(:name => title.strip)
if item.changed?
   results.newItemsCount += 1
end
item = Item.f



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

分享到: