开发者

Rails - Acts_as_versioned ------ save_without_revision

开发者 https://www.devze.com 2023-01-23 15:40 出处:网络
I\'m using acts_as_versioned for images. Though it\'s pos开发者_运维百科sible in my app to update just the title, which shouldn\'t be a version as version are for image replacements.

I'm using acts_as_versioned for images. Though it's pos开发者_运维百科sible in my app to update just the title, which shouldn't be a version as version are for image replacements.

Problem is, if you update just the title, acts_as_versioned creates a new version which breaks everything. So when calling the model def update_title for photos, I want to try what I found in the DOC:

save_without_revision: http://ar-versioned.rubyforge.org/classes/ActiveRecord/Acts/Versioned/ActMethods.html#M000008

But I don't know how to do that? Where do I include this? Somewhere, somehow in the controller?

Thanks


You would use it like regular active record, in your controller. eg:

@article.save_without_revision

I recommend you use vestal_versions anyhow.

0

精彩评论

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

关注公众号