Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Add method getting non deleted record after unscoped #92

Open
wants to merge 1 commit into
base: rails3.2
Choose a base branch
from

Conversation

hmsk
Copy link

@hmsk hmsk commented Jan 17, 2013

A proposal to solve problem that unscoped removing a check of deleted or not.
I'd unscope only default_scope by just a method.

class Model < AR::Base
  acts_as_paranoid
  default_scope ->{ :updated_at > 3.days.ago }
end

Model.all #=> 'where deleted_at = NULL and updated_at > 3.days.ago'
Model.unscoped #=> 'nothing condition'
Model.active_on_unscoped #=> 'where deleted_at = NULL'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants