开发者

How to determine if a Rails object is marked_for_destruction?

I have some objects which happen to be nested_attributes of something else. When they are marked to be deleted, Rails creates a property "marke开发者_如何学God_for_destruction". How do I read this var?

Sample Yaml dump:

--- &id001 !ruby/object:LineItem 
attributes: 
  name:Pay
  created_at: 2009-10-12 16:30:51
  updated_at: 2009-10-12 16:30:51
  statement_id: "8"
  amount: "234"
  id: "33"
attributes_cache: {}

errors: !ruby/object:ActiveRecord::Errors 
  base: *id001
  errors: {}

marked_for_destruction: true


object.marked_for_destruction?
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜