I'm not a fan (in Ruby) of having a method used in two different ways depending on the context of the parameters.

In this case, you're handling everything differently if there are any movies in the year, only it's not very readable to tell that's what's happening. 

Try adding a conditional and seeing if this brings about other code:

```ruby
def calculate_ratings_average(searched_movies, year)
  movies_for_year = searched_movies.select{ |movie| movie.year == year}
  if movies_for_year = []
    # handle condition with nothing
  else
    average_rating = ...
end
```