check for Hash in addition to OrderedHash, which seems to break in Rails 4, for total_count