开发者

Is it possible to save all documents once again?

I am wondering, is there any o开发者_JS百科peration in rails console that does something like below ??

a = Article.all
foreach a as article
    article.save
end


Sure, I've got an Article model too and just tried it in rails console:

ruby-1.9.2-p180 :002 > Article.all.each(&:save) 
=> [#<Article id: ...

So what did that accomplish?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜