```ruby
def tag_cloud(tags, classes)
  return [] if no_tags?(tags)
  ....
end

def no_tags?(tags)
  if tags.is_a?(ActiveRecord::Relation)
    tags.count(:all).zero?
  else
    tags.blank?
   end
end
```