Class: Admin::UrlRewritesController::Collection

Inherits:
Katalyst::Tables::Collection::Base
  • Object
show all
Defined in:
app/controllers/admin/url_rewrites_controller.rb

Instance Method Summary collapse

Instance Method Details

#filterObject



73
74
75
76
77
78
79
80
81
82
83
84
# File 'app/controllers/admin/url_rewrites_controller.rb', line 73

def filter
  self.items = items.admin_search(search) if search.present?

  self.items = case scope&.to_sym
               when :active
                 items.where(active: true)
               when :inactive
                 items.where(active: false)
               else
                 items
               end
end