Class: Fish0::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/fish0/collection.rb

Instance Method Summary collapse

Instance Method Details

#cache_keyObject



3
4
5
6
7
8
9
# File 'lib/fish0/collection.rb', line 3

def cache_key
  most_recent = select(&:updated_at).sort_by(&:updated_at).last

  timestamp = time_to_string(most_recent ? most_recent.updated_at : Time.zone.now)

  "#{objects_key}-#{timestamp}"
end