Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added without_default_scope option #301

Merged
merged 4 commits into from
Feb 1, 2016

Conversation

westonganger
Copy link
Contributor

I added an option to skip the default_scope. This makes the gem much more versatile and not susceptible to all the problems that come with default_scope.

@jhawthorn
Copy link
Collaborator

Thank you @westonganger. I love this.

Is it possible to add a test?

@westonganger
Copy link
Contributor Author

I have added a test for this.

jhawthorn added a commit that referenced this pull request Feb 1, 2016
Added without_default_scope option
@jhawthorn jhawthorn merged commit 6844662 into rubysherpas:rails4 Feb 1, 2016
@jhawthorn
Copy link
Collaborator

Awesome. Thanks.

@reicheltd
Copy link

Works thx. Had to move from 2.1 to current rails4 branch.

@jrochkind
Copy link

Hi, I could really use this feature, will a paranoia 2.2 with it included be released anytime soon?

@jrochkind
Copy link

FWIW, for others coming across this, here's how I monkey-patched it in, roughly, in the specific class where I needed it...

    acts_as_paranoid without_default_scope: true

  paranoia_spec = Gem.loaded_specs["paranoia"]
  if paranoia_spec.version < Gem::Version.new('2.2')
    default_scopes.delete_if do |scope|
      scope.source_location.first.start_with? paranoia_spec.full_gem_path
    end
    class << self; alias_method :without_deleted, :paranoia_scope end
  end

@westonganger westonganger deleted the rails4 branch May 25, 2018 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants