lib/has_karma.rb in thumbs_up-0.3.1 vs lib/has_karma.rb in thumbs_up-0.3.2
- old
+ new
@@ -11,10 +11,10 @@
module ClassMethods
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] ? options[:weight] : 1).to_f ]
+ self.karmic_objects[voteable_type.to_s.classify.constantize] = [ (options[:as] ? options[:as].to_s.foreign_key : self.name.foreign_key), (options[:weight] || 1).to_f ]
end
end
module SingletonMethods