Style note - you can avoid creating and returning the `profiles` variable, and the `else` clause entirely. In Ruby, an if/else's return value is the value of the last line of whichever piece of it got executed. In the `if` case here, that's the array of profiles, and the `else` clause is nil. In Ruby, if there is no `else` clause, and the `if` condition didn't match, the condition evaluates to nil anyway. So the method will function identically written like this:

```ruby
def self.profiles_for(models, params)
  models = [models] unless models.is_a?(Array)
  if params.has_key? "search.profile"
    models.map {|m| m.search_profiles[params["search.profile"].to_sym]}.flatten
  end
end
```