Skip to content
Browse files

oops. removing code that only worked in test

  • Loading branch information...
1 parent 8911821 commit 31a2172221ed782c0e46b30c2bf6243919455f50 Matt E. Patterson committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/acts_as_mongo_taggable.rb
View
6 lib/acts_as_mongo_taggable.rb
@@ -27,14 +27,14 @@ def all_tags_with_counts
def find_with_tag(phrase, opts={})
phrase = phrase.downcase unless opts[:case_sensitive] == true
tag = Tag.first({:select => 'taggable_id', :taggable_class => self.to_s, :word => phrase})
- Widget.first(:id => tag.taggable_id)
+ first(:id => tag.taggable_id)
end
def find_all_with_tag(phrase, opts={})
phrase = phrase.downcase unless opts[:case_sensitive] == true
tags = Tag.all({:select => 'taggable_id', :taggable_class => self.to_s, :word => phrase})
widget_ids = tags.collect{|t| t.taggable_id}.uniq
- Widget.all(:id => widget_ids)
+ all(:id => widget_ids)
end
def most_tagged_with(phrase, opts={})
@@ -45,7 +45,7 @@ def most_tagged_with(phrase, opts={})
counts = Hash.new(0)
widget_ids.each{|id| counts[id] += 1}
id = counts.sort{|a,b| a[1] <=> b[1]}.reverse.first[0]
- Widget.find(id)
+ find(id)
end
end

0 comments on commit 31a2172

Please sign in to comment.
Something went wrong with that request. Please try again.