You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/app/models/praise_tread_cache.rb

12 lines
296 B

class PraiseTreadCache < ActiveRecord::Base
attr_accessible :object_id,:object_type,:praise_num,:tread_num
def plus(num)
self.update_attribute(:praise_num, self.praise_num.to_i + num)
end
def minus(num)
self.update_attribute(:praise_num, self.praise_num.to_i - num)
end
end