开发者

Will update_attributes release lock in Rails?

Code

@abc = Abc.find(1,:lock => true)
@abc.update_attributes!(:title => "ABC title")

update_attributes will relea开发者_JAVA百科se a lock or not ? OR only @abc.save! will release a lock ?


# File activeresource/lib/active_resource/base.rb, line 1267
def update_attributes(attributes)
  load(attributes) && save
end

So if save releases a lock, then update_attributes will do the same.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜