Commit 59d5b8f6f400f96988ea2d9c1769ad9a0ef0b7ce
1 parent
2f21005a
Exists in
master
and in
29 other branches
rails3: adjust vote_fu to rails3
Showing
3 changed files
with
6 additions
and
6 deletions
Show diff stats
vendor/plugins/vote_fu/examples/voteable.rb
vendor/plugins/vote_fu/lib/models/vote.rb
1 | 1 | class Vote < ActiveRecord::Base |
2 | 2 | |
3 | - named_scope :for_voter, lambda { |*args| {:conditions => ["voter_id = ? AND voter_type = ?", args.first.id, args.first.class.base_class.name]} } | |
4 | - named_scope :for_voteable, lambda { |*args| {:conditions => ["voteable_id = ? AND voteable_type = ?", args.first.id, args.first.class.base_class.name]} } | |
5 | - named_scope :recent, lambda { |*args| {:conditions => ["created_at > ?", (args.first || 2.weeks.ago).to_s(:db)]} } | |
6 | - named_scope :descending, :order => "created_at DESC" | |
3 | + scope :for_voter, lambda { |*args| {:conditions => ["voter_id = ? AND voter_type = ?", args.first.id, args.first.class.base_class.name]} } | |
4 | + scope :for_voteable, lambda { |*args| {:conditions => ["voteable_id = ? AND voteable_type = ?", args.first.id, args.first.class.base_class.name]} } | |
5 | + scope :recent, lambda { |*args| {:conditions => ["created_at > ?", (args.first || 2.weeks.ago).to_s(:db)]} } | |
6 | + scope :descending, :order => "created_at DESC" | |
7 | 7 | |
8 | 8 | # NOTE: Votes belong to the "voteable" interface, and also to voters |
9 | 9 | belongs_to :voteable, :polymorphic => true | ... | ... |
vendor/plugins/vote_fu/lib/vote_fu.rb
... | ... | @@ -6,4 +6,4 @@ require 'models/vote.rb' |
6 | 6 | ActiveRecord::Base.send(:include, Juixe::Acts::Voteable) |
7 | 7 | ActiveRecord::Base.send(:include, PeteOnRails::Acts::Voter) |
8 | 8 | ActiveRecord::Base.send(:include, PeteOnRails::VoteFu::Karma) |
9 | -RAILS_DEFAULT_LOGGER.info "** vote_fu: initialized properly." | |
9 | +Rails.logger.info "** vote_fu: initialized properly." | ... | ... |