module ThumbsUp::Karma::ClassMethods
Public Instance Methods
has_karma(voteable_type, options = {})
click to toggle source
# File lib/has_karma.rb, line 12 def has_karma(voteable_type, options = {}) include ThumbsUp::Karma::InstanceMethods extend ThumbsUp::Karma::SingletonMethods self.karmic_objects ||= {} self.karmic_objects[voteable_type.to_s.classify.constantize] = [ (options[:as] ? options[:as].to_s.foreign_key : self.name.foreign_key), [ (options[:weight] || 1) ].flatten.map(&:to_f) ] end