leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
535 stars 215 forks source link

Rails 4.2.3, Can't skip with default_scope #351

Open rohitpbhore opened 6 years ago

rohitpbhore commented 6 years ago

wice_grid 3.6.0.pre5 & Rails 4.2.3

Example: Into model

class Product < ActiveRecord::Base
  default_scope { where(archived: false) }
end

Into controller action

@products = initialize_grid(
  Product.unscoped
)

Still it adds where condition of default scope

vedsingh-fullstack commented 6 years ago

@leikind could you please help us resolving this issue?

leikind commented 6 years ago

Sorry, I am not supporting this gem anymore.

nathanvda commented 6 years ago

This is a weird bug. There is a setting USE_DEFAULT_SCOPE inside the configuration-file, but if set, it will actually just use the relation as given (imho). While the default case will always force the unscoped case.