`... |safe = false|` is not supported under 1.8, sorry i missed it, please try:
```ruby
def ContentView.promoted(safe = false)
  relation = self.joins(:environments).group('"content_views"."id"').having('count("environment"."id") > 1') 
  if safe
     # do not include group and having in returned relation
     self.where :id => relation.all.map(&:id)
  else
    relation
  end
end
```
should work