<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Acts As Voteable Rails Plugin</title>
	<atom:link href="http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/</link>
	<description>Break Coders Block!</description>
	<lastBuildDate>Fri, 12 Mar 2010 21:40:20 -0700</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 0x4a6f4672</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-10285</link>
		<dc:creator>0x4a6f4672</dc:creator>
		<pubDate>Tue, 02 Feb 2010 12:22:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-10285</guid>
		<description>With the newest version of rails (2.3.5) there will be the same error as in the &quot;Acts as Rateable&quot; plugin: “The :dependent option expects either :destroy, :delete_all, or :nullify (true)”

As the others already remarked, :dependent =&gt; :true must be changed in  :dependent =&gt; :destroy to make it work (line 12 in vendor/plugins/acts_as_voteable/lib/acts_as_voteable.rb).</description>
		<content:encoded><![CDATA[<p>With the newest version of rails (2.3.5) there will be the same error as in the &#8220;Acts as Rateable&#8221; plugin: “The :dependent option expects either :destroy, :delete_all, or :nullify (true)”</p>
<p>As the others already remarked, :dependent =&gt; :true must be changed in  :dependent =&gt; :destroy to make it work (line 12 in vendor/plugins/acts_as_voteable/lib/acts_as_voteable.rb).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RubyWorm</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-3166</link>
		<dc:creator>RubyWorm</dc:creator>
		<pubDate>Mon, 07 Sep 2009 11:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-3166</guid>
		<description>@Steve Eppley =) seriously chill!  and get a life ;)

@TechKnow great blog man, and awesome plugins many thanks :)</description>
		<content:encoded><![CDATA[<p>@Steve Eppley =) seriously chill!  and get a life ;)</p>
<p>@TechKnow great blog man, and awesome plugins many thanks :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Eppley</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-2364</link>
		<dc:creator>Steve Eppley</dc:creator>
		<pubDate>Wed, 19 Aug 2009 01:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-2364</guid>
		<description>I&#039;m writing to ask you to rename this plugin. Its name is too generic; voting can comprise many other kinds of activity besides user ratings. (Traditionally, voting refers to a group choosing from a set of alternatives, a.k.a. candidates. There&#039;s a rich body of academic literature known as &quot;social choice theory.&quot;) Perhaps acts_as_rateable would be a more appropriate name? Then the name acts_as_voteable could be reserved for a plugin that handles other kinds of voting.
     The plugin for voting that I hope to find (or develop myself) would be similar to acts_as_list, in that it would facilitate allowing the voter to sort a collection of alternatives into his/her desired order of preference. It would differ from acts_as_list--assuming my understanding of acts_as_list is correct; I&#039;m new to Rails--in that a voter&#039;s order of preference may have more than one alternative per position. (Known as a &quot;nonlinear&quot; or &quot;nonstrict&quot; or &quot;weak&quot; ordering.) That would allow the voter to express indifference between those alternatives. There are several reasons to allow expression of indifference: (1) A voter may sincerely be indifferent between some alternatives. (2) The list of alternatives when initially presented to the voter should not necessarily be ordered since a pre-ordered ballot could affect the votes, so before the voter sorts the alternatives they would initially all appear at the same position. (3) In some elections there could be so many alternatives that it would be too tedious for voters to order them all; it would save time if the voter may leave some alternatives &quot;unranked,&quot; which would be treated as if the voter had ranked them together at the bottommost position. (4) It may be desirable to allow voters to strategically vote &quot;insincere&quot; indifference between some alternatives. (If you&#039;re curious why that can be desirable, you can google the &quot;Minimal Defense&quot; criterion or the &quot;Strong Defensive Strategy Criterion.&quot;)
     The reason I&#039;m looking for such a plugin is because I want to construct an online voting server that implements the Maximize Affirmed Majorities (MAM) voting method and (if I have time) the Voting for a Published Ranking (VPR) voting method. If you want more details, feel free to ask me.
     Thanks for considering this, and best wishes,
     Steve</description>
		<content:encoded><![CDATA[<p>I&#8217;m writing to ask you to rename this plugin. Its name is too generic; voting can comprise many other kinds of activity besides user ratings. (Traditionally, voting refers to a group choosing from a set of alternatives, a.k.a. candidates. There&#8217;s a rich body of academic literature known as &#8220;social choice theory.&#8221;) Perhaps acts_as_rateable would be a more appropriate name? Then the name acts_as_voteable could be reserved for a plugin that handles other kinds of voting.<br />
     The plugin for voting that I hope to find (or develop myself) would be similar to acts_as_list, in that it would facilitate allowing the voter to sort a collection of alternatives into his/her desired order of preference. It would differ from acts_as_list&#8211;assuming my understanding of acts_as_list is correct; I&#8217;m new to Rails&#8211;in that a voter&#8217;s order of preference may have more than one alternative per position. (Known as a &#8220;nonlinear&#8221; or &#8220;nonstrict&#8221; or &#8220;weak&#8221; ordering.) That would allow the voter to express indifference between those alternatives. There are several reasons to allow expression of indifference: (1) A voter may sincerely be indifferent between some alternatives. (2) The list of alternatives when initially presented to the voter should not necessarily be ordered since a pre-ordered ballot could affect the votes, so before the voter sorts the alternatives they would initially all appear at the same position. (3) In some elections there could be so many alternatives that it would be too tedious for voters to order them all; it would save time if the voter may leave some alternatives &#8220;unranked,&#8221; which would be treated as if the voter had ranked them together at the bottommost position. (4) It may be desirable to allow voters to strategically vote &#8220;insincere&#8221; indifference between some alternatives. (If you&#8217;re curious why that can be desirable, you can google the &#8220;Minimal Defense&#8221; criterion or the &#8220;Strong Defensive Strategy Criterion.&#8221;)<br />
     The reason I&#8217;m looking for such a plugin is because I want to construct an online voting server that implements the Maximize Affirmed Majorities (MAM) voting method and (if I have time) the Voting for a Published Ranking (VPR) voting method. If you want more details, feel free to ask me.<br />
     Thanks for considering this, and best wishes,<br />
     Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akhil Bansal</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-154</link>
		<dc:creator>Akhil Bansal</dc:creator>
		<pubDate>Fri, 14 Nov 2008 07:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-154</guid>
		<description>@Lukas: you just need to edit lib/acts_as_votable.rb under plugin directory. And change :dependent=&gt;true to :dependent=&gt;:destroy. it will work fine.</description>
		<content:encoded><![CDATA[<p>@Lukas: you just need to edit lib/acts_as_votable.rb under plugin directory. And change :dependent=&gt;true to :dependent=&gt;:destroy. it will work fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-153</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Sat, 04 Oct 2008 13:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-153</guid>
		<description>Hello, you have an error in the module acts_as_voteable.rb:

on line 12:

:dependent =&gt; :true

On rails 2.1.1 :dependent =&gt; :true raises a fatal error. You can change for :nullify with the same effects to correct this error.

Regards.</description>
		<content:encoded><![CDATA[<p>Hello, you have an error in the module acts_as_voteable.rb:</p>
<p>on line 12:</p>
<p>:dependent =&gt; :true</p>
<p>On rails 2.1.1 :dependent =&gt; :true raises a fatal error. You can change for :nullify with the same effects to correct this error.</p>
<p>Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Jackson</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-152</link>
		<dc:creator>Peter Jackson</dc:creator>
		<pubDate>Sun, 13 Jul 2008 21:42:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-152</guid>
		<description>I&#039;ve added some functionality to this plugin, updated it to use named_scopes, the polymorphic keyword, and a couple other goodies.

I&#039;m planning to add ranged voting (configurable as 1..10, etc) and karma-weighted voting as well.

Not sure if acts_as_voteable is still being maintained. If it is, I&#039;m happy to fold my changes into the main project.

Otherwise, you can see my enhancements on GitHub, &lt;a href=&quot;http://github.com/peteonrails/vote_fu/tree/master&quot; rel=&quot;nofollow&quot;&gt;Vote Fu&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve added some functionality to this plugin, updated it to use named_scopes, the polymorphic keyword, and a couple other goodies.</p>
<p>I&#8217;m planning to add ranged voting (configurable as 1..10, etc) and karma-weighted voting as well.</p>
<p>Not sure if acts_as_voteable is still being maintained. If it is, I&#8217;m happy to fold my changes into the main project.</p>
<p>Otherwise, you can see my enhancements on GitHub, <a href="http://github.com/peteonrails/vote_fu/tree/master" rel="nofollow">Vote Fu</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Announcing VoteFu &#124; Pete On Rails</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-151</link>
		<dc:creator>Announcing VoteFu &#124; Pete On Rails</dc:creator>
		<pubDate>Sun, 13 Jul 2008 20:45:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-151</guid>
		<description>[...] is a voting mixin that allows you to extend your models to vote on one another. Largely based on Cosmin Radoi&#8217;s acts_as_voteable plugin, VoteFu adds named_scope support, a set of generators to make using the plugin easier, a [...]</description>
		<content:encoded><![CDATA[<p>[...] is a voting mixin that allows you to extend your models to vote on one another. Largely based on Cosmin Radoi&#8217;s acts_as_voteable plugin, VoteFu adds named_scope support, a set of generators to make using the plugin easier, a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramon Tayag</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-150</link>
		<dc:creator>Ramon Tayag</dc:creator>
		<pubDate>Tue, 26 Feb 2008 09:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-150</guid>
		<description>It&#039;s been a while since you&#039;ve made changes.. but I was wondering, is there a &quot;neutral&quot; vote?</description>
		<content:encoded><![CDATA[<p>It&#8217;s been a while since you&#8217;ve made changes.. but I was wondering, is there a &#8220;neutral&#8221; vote?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dict</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-149</link>
		<dc:creator>dict</dc:creator>
		<pubDate>Wed, 01 Aug 2007 17:45:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-149</guid>
		<description>Is a reputation system planned (i.e. each vote can have a weight based on the user that expressed it)?

If not, any idea on how it should be implemented?

Keeping the reputation count in User can be expensive when retrieving the vote count for a voteable (each vote would have to be multiplied by the reputation every time), but storing the reputation in the vote it&#039;s not right because it varies with time.

What do you think?</description>
		<content:encoded><![CDATA[<p>Is a reputation system planned (i.e. each vote can have a weight based on the user that expressed it)?</p>
<p>If not, any idea on how it should be implemented?</p>
<p>Keeping the reputation count in User can be expensive when retrieving the vote count for a voteable (each vote would have to be multiplied by the reputation every time), but storing the reputation in the vote it&#8217;s not right because it varies with time.</p>
<p>What do you think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Brock</title>
		<link>http://juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/comment-page-1/#comment-148</link>
		<dc:creator>Zach Brock</dc:creator>
		<pubDate>Fri, 13 Jul 2007 19:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/#comment-148</guid>
		<description>I had the same issue as Dan, but I solved it by creating a new instance method.

Just stick this under module InstanceMethods

&lt;pre&gt;
def vote (value, user)
  if user
    self.votes.each { &#124;v&#124;
      if user.id == v.user_id
        if v.vote == value
          return false
        else
          v.update_attribute(:vote, value)
          return true
        end
      end
    }
    self.votes  value, :user_id =&gt; user.id)
    return true
  end
end
&lt;/pre&gt;

To use it just call rated_item.vote value, user for instance:  ad.vote true, user

One quick caveat, you need to pass it actual boolean values or the comparison doesn&#039;t work (at least with MySQL).  So I have

&lt;pre&gt;
vote_value = false
vote_value = true if params[:vote] == &#039;true&#039;
ad.vote vote_value, user
&lt;/pre&gt;

in my controller.  Hope this helps someone...</description>
		<content:encoded><![CDATA[<p>I had the same issue as Dan, but I solved it by creating a new instance method.</p>
<p>Just stick this under module InstanceMethods</p>
<pre>
def vote (value, user)
  if user
    self.votes.each { |v|
      if user.id == v.user_id
        if v.vote == value
          return false
        else
          v.update_attribute(:vote, value)
          return true
        end
      end
    }
    self.votes  value, :user_id =&gt; user.id)
    return true
  end
end
</pre>
<p>To use it just call rated_item.vote value, user for instance:  ad.vote true, user</p>
<p>One quick caveat, you need to pass it actual boolean values or the comparison doesn&#8217;t work (at least with MySQL).  So I have</p>
<pre>
vote_value = false
vote_value = true if params[:vote] == 'true'
ad.vote vote_value, user
</pre>
<p>in my controller.  Hope this helps someone&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
