Module: ThumbsUp::Karma::ClassMethods
- Defined in:
- lib/has_karma.rb
Instance Method Summary collapse
Instance Method Details
#has_karma(voteable_type, options = {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/has_karma.rb', line 12 def has_karma(voteable_type, = {}) include ThumbsUp::Karma::InstanceMethods extend ThumbsUp::Karma::SingletonMethods self.karmic_objects ||= {} self.karmic_objects[voteable_type.to_s.classify.constantize] = [ ([:as] ? [:as].to_s.foreign_key : self.name.foreign_key), [ ([:weight] || 1) ].flatten.map(&:to_f) ] end |