Skip to content

Instantly share code, notes, and snippets.

@yorzi
Created June 23, 2011 04:41
Show Gist options
  • Save yorzi/1041916 to your computer and use it in GitHub Desktop.
Save yorzi/1041916 to your computer and use it in GitHub Desktop.
default_scope will interrupt the update_attributes on the AR outside the default_scope, below solution will work.
#default_scope will interrupt the update_attributes on the AR outside the default_scope, below solution will work.
#with_exclusive_scope is protected, so you have to create a class method:
def self.include_deleted_in
Post.with_exclusive_scope { yield }
end
#then in your controller call
Post.include_deleted_in {Post.find(:all)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment