Class Vote
In: app/models/vote.rb
Parent: ActiveRecord::Base

Currently only used for tracking purposes.

Methods

Public Instance methods

Returns true if this vote was an initial (PeerGroupMembership) vote.

[Source]

    # File app/models/vote.rb, line 47
47:   def initial?
48:     return (self.kind == Const::Vote::INITIAL)
49:   end

Returns true if this vote is powered.

[Source]

    # File app/models/vote.rb, line 41
41:   def powered?
42:     return (self.weight != 0)
43:   end

Protected Instance methods

Logs creation to log.logilogi.org

[Source]

    # File app/models/vote.rb, line 57
57:   def log_create_to_log_log
58:     if GlobalConfig.use_log_log
59:       if self.score > 0
60:         m = LogLogMessage.new(
61:             :kind => "Vote",
62:             :channel_names => ['all', 'votes',
63:                 'for_' + self.rating.logi.creator.unix_name].join(','),
64:             :author => self.user.name,
65:             :title => 'For: ' + self.rating.logi.current_title,
66:             :text => 'Score: ' + self.score.to_s + 
67:                 ' (weight: ' + self.weight.to_s + ")\n" +
68:                 'It\'s average rating is now: ' + self.rating.score.to_s + 
69:                 ' (weight: ' + self.rating.weight.to_s + ')',
70:             :url => GlobalConfig.site_url + self.rating.logi.link.to_s)
71:         m.save
72:       end
73:     end
74:   end

[Validate]