vote_fu to work in Heroku (Postgres)
In order to make vote_fu work in Heroku’s PostgreSQL you need to make a slight modification in the tally method, to follow a classical SQL notation:
Add this method in acts_as_voteable.rb just after options_for_tally method:
def column_names_for_tally
column_names.map { |column| "#{table_name}.#{column}" }.join(", ")
end
In options_for_tally method find line that starts with “group_by =” and replace it with:
group_by = "#{Vote.table_name}.voteable_id, #{column_names_for_tally}"
That’s it. Should work now.
- Programming Language:
- Tags:



Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago