Sha256: eb13ee63347f10488d033226347027bdf8fa4a90f922636df56187af29da43d6
Contents?: true
Size: 336 Bytes
Versions: 6
Compression:
Stored size: 336 Bytes
Contents
class Counter < ActiveRecord::Base belongs_to :owner, :polymorphic => true def increment! set count + 1 end def increment_by!(value) set count + value end def decrement! set count - 1 end def decrement_by!(value) set count - value end def set(value) update! count: value end end
Version data entries
6 entries across 6 versions & 2 rubygems