```ruby
class CategoriesController < ApplicationController
  skip_authorization_check

  def index
    @categories ||= CategoryDecorator.decorate_collection(Category.all)
  end
end
```

Load all subcategories at once
user
```ruby
class CategoriesController < ApplicationController
  skip_authorization_check

  def index
    categories = Category.includes(:subcategories)
    @categories ||= CategoryDecorator.decorate_collection(categories)
  end
end
```
assistant