阅读背景:

应用Rails default_scope进行更新

来源:互联网 

I'm using default_scope in rails to siphon out anything that has a value of is_deleted = true (anything with this value should never be shown, but I still want to keep the row in the database). But there is one controller action that should actually undelete something (sets is_deleted = false), but it's failing because the default_scope is being applied. It's my understanding that the default_scope is only applied when selecting / creating a record but not when updating (source: I'm using default_scope in rails to siphon out




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

分享到: