lib/fish0/concerns/cacheable.rb in fish0-0.0.14 vs lib/fish0/concerns/cacheable.rb in fish0-0.0.15
- old
+ new
@@ -3,14 +3,13 @@
module Cacheable
extend ActiveSupport::Concern
included do
def cache_key(*timestamp_names)
- case
- when timestamp_names.any?
+ if timestamp_names.any?
timestamp = max_updated_column_timestamp(timestamp_names)
"#{self.class.to_s.tableize}/#{primary_key_value}-#{timestamp.utc.to_s(:nsec)}"
- when timestamp = max_updated_column_timestamp
+ elsif timestamp = max_updated_column_timestamp
"#{self.class.to_s.tableize}/#{primary_key_value}-#{timestamp.utc.to_s(:nsec)}"
else
"#{self.class.to_s.tableize}/#{primary_key_value}"
end
end