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

undefined method `scoped' when use orphan_strategy #301

Closed
Pogoss opened this issue Oct 28, 2016 · 5 comments
Closed

undefined method `scoped' when use orphan_strategy #301

Pogoss opened this issue Oct 28, 2016 · 5 comments

Comments

@Pogoss
Copy link

Pogoss commented Oct 28, 2016

I'm using orphan_strategy => :restrict and using this wiki page https://github.com/stefankroes/ancestry/wiki/Using-orphan-restrict

But when i try to destroy parent i'm getting this error: undefined method `scoped'

    rescue Ancestry::AncestryException => exc
      @taxons = Taxon.scoped
      flash[:alert] = "Taxon #{exc.taxon.downcase}"
      render :index
    end
@kbrock
Copy link
Collaborator

kbrock commented Oct 28, 2016

Hello @Pogoss
What version of ancestry and rails (or active record) are you running?
Thanks

@Pogoss
Copy link
Author

Pogoss commented Oct 31, 2016

@kbrock
ancestry 2.1.0
rails 4.2.6

@kbrock
Copy link
Collaborator

kbrock commented Nov 1, 2016

Hello @Pogoss

I wonder if the example is 3.0 code.
Would you try the rails 4.0 example and let me know if this works for you?
I will update the wiki documentation if this works for you.

    rescue Ancestry::AncestryException => exc
      @taxons = Taxon.scoped
      flash[:alert] = "Taxon #{exc.taxon.downcase}"
      render :index
    end

--Keenan

@kbrock
Copy link
Collaborator

kbrock commented Aug 9, 2017

@Pogoss did this fix your problem?

@kbrock
Copy link
Collaborator

kbrock commented Sep 5, 2018

let me know if this is still a problem

@kbrock kbrock closed this as completed Sep 5, 2018
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

No branches or pull requests

2 participants