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

scope does not work as expected #47

Open
anonymuss opened this issue Mar 11, 2015 · 0 comments
Open

scope does not work as expected #47

anonymuss opened this issue Mar 11, 2015 · 0 comments

Comments

@anonymuss
Copy link

Hello

I can not get scope to work as described in readme.
I use nestable_list and all the other configuration params work, but not scope. Could someone explain what i did wrong?

My rails_admin configuration file

 nestable_list({
  scope: :active,
  live_update: false
 })

Scopes are defined in my class as:

  scope :active, -> {where(status: "active")}
  scope :inactive, -> {where(status: "inactive")}
  scope :draft, -> {where(status: "draft")}
  scope :deleted, -> {where(status: "deleted")}

I have also tried using Proc.new to define my condition, but with no success.

Using default_scope as "active" it kinda works, but it doesn't play well with rails_admin edit option, because I can not edit articles that are not active.

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

1 participant