Created
June 23, 2011 04:41
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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