Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Fix tag count error in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Bullock committed Feb 29, 2016
1 parent 4edd5e4 commit 3caf109
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 86 deletions.
8 changes: 0 additions & 8 deletions app/controllers/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,6 @@ def require_current_user

def popular_tags(limit = 20, type = nil)
ActsAsTaggableOn::Tag.popular(limit, type)
=begin
if type == nil
ActsAsTaggableOn::Tag.most_used(limit)
else
klass = Object.const_get type
klass.tag_counts.most_used(limit)
end
=end
end


Expand Down
10 changes: 1 addition & 9 deletions app/controllers/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ def auto_complete_for_tag_name
end

def index
@tags = popular_tags(100).to_a

@user_tags = popular_tags(75, 'User').to_a

@post_tags = popular_tags(75, 'Post').to_a

@photo_tags = popular_tags(75, 'Photo').to_a

@clipping_tags = popular_tags(75, 'Clipping').to_a
@tags = popular_tags(100)
end


Expand Down
8 changes: 6 additions & 2 deletions app/models/acts_as_taggable_on/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ class ActsAsTaggableOn::Tag < ActiveRecord::Base

class << self
def popular(limit = 20, type = nil)
tags = ActsAsTaggableOn::Tag.most_used(limit)
tags
if type == nil
ActsAsTaggableOn::Tag.most_used(limit)
else
klass = Object.const_get type
klass.tag_counts.most_used(limit)
end
end

def default_per_page
Expand Down
67 changes: 0 additions & 67 deletions config/initializers/tag_extensions.rb

This file was deleted.

0 comments on commit 3caf109

Please sign in to comment.