1 - Avatar added

This should not be assigning `@sites`. You just want this method to return the sites, either all of them or filtered by the search. Its better to not force the other pieces inside the search method, such as the ordering and the paginating

```ruby
def self.search
  if search
    where("title ILIKE?", "%#{search}%")
  else
    all
  end
end
```

Then you can handle the ordering/pagination in the controller:

```ruby
# app/controllers/sites_controller.rb

def index
  @sites = Site.search(params[:search]).order(:title).page(params[:page])
end
```