Sha256: 7b267b05a62454d4e3294300a27bd5912243a6a32a723e86dd826d4501860c7b
Contents?: true
Size: 403 Bytes
Versions: 10
Compression:
Stored size: 403 Bytes
Contents
module Viewable protected def update_view_count(viewable) stack_name = viewable.class.to_s.underscore.downcase already_viewed = (cookies[stack_name] || '').split(',') unless already_viewed.include?(viewable.id.to_s) cookies[stack_name] = (already_viewed << viewable.id.to_s).join(',') viewable.class.update_counters(viewable.id, {:view_count => 1}) end end end
Version data entries
10 entries across 10 versions & 1 rubygems