Permalink
Browse files

passing tests with acts_as_taggable_on

  • Loading branch information...
1 parent 7bf6baf commit d717b2de78fa8f031f78a864f5280c4479e7f958 @bborn committed Feb 17, 2012
Showing with 1,931 additions and 89 deletions.
  1. +2 −0 Gemfile
  2. +2 −2 UPGRADING.markdown
  3. +1 −1 app/controllers/base_controller.rb
  4. +1 −1 app/controllers/posts_controller.rb
  5. +19 −19 app/controllers/tags_controller.rb
  6. +1 −1 app/helpers/base_helper.rb
  7. +72 −0 app/models/acts_as_taggable_on/tag.rb
  8. +4 −1 app/models/clipping.rb
  9. +1 −1 app/models/photo.rb
  10. +1 −1 app/models/post.rb
  11. +0 −36 app/models/tag.rb
  12. +1 −1 app/models/user.rb
  13. +1 −1 app/views/activities/index.html.haml
  14. +1 −1 app/views/forums/show.html.haml
  15. +3 −3 app/views/photos/index.html.haml
  16. +1 −1 app/views/shared/_footer_content.html.haml
  17. +1 −1 app/views/tags/edit.html.haml
  18. +1 −1 app/views/tags/index.html.haml
  19. +1 −1 app/views/tags/manage.html.haml
  20. +2 −2 app/views/tags/show.html.haml
  21. +1 −1 community_engine.gemspec
  22. +16 −0 db/migrate/080_migrate_to_acts_as_taggable_on.rb
  23. +1 −1 lib/community_engine.rb
  24. +6 −1 test/fixtures/taggings.yml
  25. +3 −2 test/functional/users_controller_test.rb
  26. +2 −0 test/test_helper.rb
  27. +26 −0 test/testapp/db/migrate/20120217133612_create_users.rb
  28. +11 −0 test/testapp/db/migrate/20120217133613_add_activation_code_to_user.rb
  29. +22 −0 test/testapp/db/migrate/20120217133614_create_photos.rb
  30. +21 −0 test/testapp/db/migrate/20120217133615_add_tag_support.rb
  31. +14 −0 test/testapp/db/migrate/20120217133616_create_friendships.rb
  32. +18 −0 test/testapp/db/migrate/20120217133617_add_comments_tables.rb
  33. +13 −0 test/testapp/db/migrate/20120217133618_create_friendship_statuses.rb
  34. +14 −0 test/testapp/db/migrate/20120217133619_add_friendship_statuses.rb
  35. +16 −0 test/testapp/db/migrate/20120217133620_create_clippings.rb
  36. +14 −0 test/testapp/db/migrate/20120217133621_create_invitations.rb
  37. +22 −0 test/testapp/db/migrate/20120217133622_create_homepage_features.rb
  38. +19 −0 test/testapp/db/migrate/20120217133623_create_posts.rb
  39. +13 −0 test/testapp/db/migrate/20120217133624_create_states.rb
  40. +11 −0 test/testapp/db/migrate/20120217133625_add_states.rb
  41. +15 −0 test/testapp/db/migrate/20120217133626_create_metro_areas.rb
  42. +295 −0 test/testapp/db/migrate/20120217133627_add_metro_areas.rb
  43. +20 −0 test/testapp/db/migrate/20120217133628_add_sessions_table.rb
  44. +11 −0 test/testapp/db/migrate/20120217133629_create_categories.rb
  45. +10 −0 test/testapp/db/migrate/20120217133630_change_comment_to_text_field.rb
  46. +9 −0 test/testapp/db/migrate/20120217133631_create_login_slug.rb
  47. +8 −0 test/testapp/db/migrate/20120217133632_add_category_names.rb
  48. +13 −0 test/testapp/db/migrate/20120217133633_add_denied_friendship_status.rb
  49. +13 −0 test/testapp/db/migrate/20120217133634_add_notification_preferences.rb
  50. +11 −0 test/testapp/db/migrate/20120217133635_create_countries.rb
  51. +230 −0 test/testapp/db/migrate/20120217133636_add_countries.rb
  52. +9 −0 test/testapp/db/migrate/20120217133637_add_us_to_existing_metro_areas.rb
  53. +9 −0 test/testapp/db/migrate/20120217133638_add_country_id_to_users.rb
  54. +14 −0 test/testapp/db/migrate/20120217133639_add_us_to_users_with_states.rb
  55. +9 −0 test/testapp/db/migrate/20120217133640_add_users_counter_cache.rb
  56. +10 −0 test/testapp/db/migrate/20120217133641_news_to_talk.rb
  57. +9 −0 test/testapp/db/migrate/20120217133642_featured_users.rb
  58. +9 −0 test/testapp/db/migrate/20120217133643_add_last_login.rb
  59. +9 −0 test/testapp/db/migrate/20120217133644_track_emailed.rb
  60. +11 −0 test/testapp/db/migrate/20120217133645_create_skills.rb
  61. +12 −0 test/testapp/db/migrate/20120217133646_create_offerings.rb
  62. +13 −0 test/testapp/db/migrate/20120217133647_add_zag_to_users.rb
  63. +17 −0 test/testapp/db/migrate/20120217133648_create_activities_table.rb
  64. +9 −0 test/testapp/db/migrate/20120217133649_add_category_tips.rb
  65. +19 −0 test/testapp/db/migrate/20120217133650_create_events_table.rb
  66. +10 −0 test/testapp/db/migrate/20120217133651_add_privacy_to_users.rb
  67. +39 −0 test/testapp/db/migrate/20120217133652_sql_session_store_setup.rb
  68. +11 −0 test/testapp/db/migrate/20120217133653_category_improvements.rb
  69. +39 −0 test/testapp/db/migrate/20120217133654_adding_indexes.rb
  70. +20 −0 test/testapp/db/migrate/20120217133655_adding_ads.rb
  71. +30 −0 test/testapp/db/migrate/20120217133656_add_polls.rb
  72. +9 −0 test/testapp/db/migrate/20120217133657_add_activities_count.rb
  73. +73 −0 test/testapp/db/migrate/20120217133658_create_initial_schema.rb
  74. +9 −0 test/testapp/db/migrate/20120217133659_add_audience_limitation_to_ads.rb
  75. +21 −0 test/testapp/db/migrate/20120217133660_create_assets.rb
  76. +23 −0 test/testapp/db/migrate/20120217133661_create_favoritables.rb
  77. +13 −0 test/testapp/db/migrate/20120217133662_add_published_as_to_posts.rb
  78. +15 −0 test/testapp/db/migrate/20120217133663_add_published_at_to_posts.rb
  79. +28 −0 test/testapp/db/migrate/20120217133664_create_roles.rb
  80. +19 −0 test/testapp/db/migrate/20120217133665_add_more_indexes.rb
  81. +15 −0 test/testapp/db/migrate/20120217133666_add_anonymous_commenting_fields.rb
  82. +16 −0 test/testapp/db/migrate/20120217133667_create_messages.rb
  83. +19 −0 test/testapp/db/migrate/20120217133668_still_more_indexes.rb
  84. +9 −0 test/testapp/db/migrate/20120217133669_postgres_compatibility_changes.rb
  85. +11 −0 test/testapp/db/migrate/20120217133670_add_notify_to_comments.rb
  86. +15 −0 test/testapp/db/migrate/20120217133671_create_albums.rb
  87. +9 −0 test/testapp/db/migrate/20120217133672_add_album_id_to_photos.rb
  88. +9 −0 test/testapp/db/migrate/20120217133673_add_view_count_to_albums.rb
  89. +9 −0 test/testapp/db/migrate/20120217133674_add_view_count_to_photos.rb
  90. +22 −0 test/testapp/db/migrate/20120217133675_create_static_pages.rb
  91. +13 −0 test/testapp/db/migrate/20120217133676_create_rsvps.rb
  92. +29 −0 test/testapp/db/migrate/20120217133677_create_pages.rb
  93. +11 −0 test/testapp/db/migrate/20120217133678_add_pages.rb
  94. +43 −0 test/testapp/db/migrate/20120217133679_authlogic_compatibility_changes.rb
  95. +9 −0 test/testapp/db/migrate/20120217133680_add_allow_rsvp_to_events.rb
  96. +9 −0 test/testapp/db/migrate/20120217133681_add_taggings_count_to_tags.rb
  97. +19 −0 test/testapp/db/migrate/20120217133682_add_threading_to_messages.rb
  98. +16 −0 test/testapp/db/migrate/20120217133683_add_anonymous_forum_posting.rb
  99. +9 −0 test/testapp/db/migrate/20120217133684_add_comment_notification_toggle.rb
  100. +36 −0 test/testapp/db/migrate/20120217133685_paperclip_changes.rb
  101. +20 −0 test/testapp/db/migrate/20120217133686_create_authorizations.rb
  102. +18 −0 test/testapp/db/migrate/20120217133687_create_slugs.rb
  103. +18 −0 test/testapp/db/migrate/20120217133688_migrate_to_acts_as_taggable_on.rb
  104. +9 −4 test/testapp/db/schema.rb
  105. +3 −3 test/unit/{ → acts_as_taggable_on}/tag_test.rb
  106. +1 −0 test/unit/user_test.rb
  107. +2 −2 vendor/plugins/prototype_legacy_helper/lib/prototype_legacy_helper.rb
View
@@ -4,4 +4,6 @@ group :test do
gem 'sqlite3'
end
+gem 'acts-as-taggable-on', :git => "git://github.com/brady8/acts-as-taggable-on.git"
+
gemspec
View
@@ -30,8 +30,8 @@ That's it!
Note: this version adds a counter_cache to taggings, so you may need to update the counter on your existing tags by doing something like:
-Tag.all.each do |tag|
- Tag.update_counters tag.id, :taggings_count => tag.taggings.length
+ActsAsTaggableOn::Tag.all.each do |tag|
+ ActsAsTaggableOn::Tag.update_counters ActsAsTaggableOn::Tag.id, :taggings_count => ActsAsTaggableOn::Tag.taggings.length
end
If you have many tags, this could take a while, though.
@@ -95,7 +95,7 @@ def require_current_user
end
def popular_tags(limit = 20, type = nil)
- Tag.popular(limit, type)
+ ActsAsTaggableOn::Tag.popular(limit, type)
end
@@ -180,7 +180,7 @@ def popular
@monthly_popular_posts = Post.find_popular({:limit => 20, :since => 30.days})
- @related_tags = Tag.find_by_sql("SELECT tags.id, tags.name, count(*) AS count
+ @related_tags = ActsAsTaggableOn::Tag.find_by_sql("SELECT tags.id, tags.name, count(*) AS count
FROM taggings, tags
WHERE tags.id = taggings.tag_id GROUP BY tags.id, tags.name");
@@ -9,7 +9,7 @@ def cache_action?
end
def auto_complete_for_tag_name
- @tags = Tag.find(:all, :limit => 10, :conditions => [ 'LOWER(name) LIKE ?', '%' + (params[:id] || params[:tag_list]) + '%' ])
+ @tags = ActsAsTaggableOn::Tag.find(:all, :limit => 10, :conditions => [ 'LOWER(name) LIKE ?', '%' + (params[:id] || params[:tag_list]) + '%' ])
render :inline => "<%= auto_complete_result(@tags, 'name') %>"
end
@@ -26,34 +26,34 @@ def index
end
def manage
- @search = Tag.search(params[:search])
+ @search = ActsAsTaggableOn::Tag.search(params[:search])
@search.meta_sort ||= 'name.asc'
@tags = @search.page(params[:page]).per(100)
end
def edit
- @tag = Tag.find_by_name(URI::decode(params[:id]))
+ @tag = ActsAsTaggableOn::Tag.find_by_name(URI::decode(params[:id]))
end
def update
- @tag = Tag.find_by_name(URI::decode(params[:id]))
+ @tag = ActsAsTaggableOn::Tag.find_by_name(URI::decode(params[:id]))
respond_to do |format|
- if @tag.update_attributes(params[:tag])
+ if @ActsAsTaggableOn::Tag.update_attributes(params[:tag])
flash[:notice] = :tag_was_successfully_updated.l
format.html { redirect_to admin_tags_url }
format.xml { render :nothing => true }
else
format.html { render :action => "edit" }
- format.xml { render :xml => @tag.errors.to_xml }
+ format.xml { render :xml => @ActsAsTaggableOn::Tag.errors.to_xml }
end
end
end
def destroy
- @tag = Tag.find_by_name(URI::decode(params[:id]))
- @tag.destroy
+ @tag = ActsAsTaggableOn::Tag.find_by_name(URI::decode(params[:id]))
+ @ActsAsTaggableOn::Tag.destroy
respond_to do |format|
format.html {
@@ -65,11 +65,11 @@ def destroy
end
def show
- tag_names = URI::decode(params[:id])
+ tag_array = ActsAsTaggableOn::TagList.from( URI::decode(params[:id]) )
- @tags = Tag.find(:all, :conditions => [ 'name IN (?)', TagList.from(tag_names) ] )
+ @tags = ActsAsTaggableOn::Tag.find(:all, :conditions => [ 'name IN (?)', tag_array ] )
if @tags.nil? || @tags.empty?
- flash[:notice] = :tag_does_not_exists.l_with_args(:tag => tag_names)
+ flash[:notice] = :tag_does_not_exists.l_with_args(:tag => tag_array)
redirect_to :action => :index and return
end
@related_tags = @tags.first.related_tags
@@ -78,25 +78,25 @@ def show
if params[:type]
case params[:type]
when 'Post', 'posts'
- @pages = @posts = Post.recent.tagged_with(tag_names, :match_all => true).page(params[:page]).per(20)
+ @pages = @posts = Post.recent.tagged_with(tag_array).page(params[:page]).per(20)
@photos, @users, @clippings = [], [], []
when 'Photo', 'photos'
- @pages = @photos = Photo.recent.tagged_with(tag_names, :match_all => true).page(params[:page]).per(30)
+ @pages = @photos = Photo.recent.tagged_with(tag_array).page(params[:page]).per(30)
@posts, @users, @clippings = [], [], []
when 'User', 'users'
- @pages = @users = User.recent.tagged_with(tag_names, :match_all => true).page(params[:page]).per(30)
+ @pages = @users = User.recent.tagged_with(tag_array).page(params[:page]).per(30)
@posts, @photos, @clippings = [], [], []
when 'Clipping', 'clippings'
- @pages = @clippings = Clipping.recent.tagged_with(tag_names, :match_all => true).page(params[:page]).per(10)
+ @pages = @clippings = Clipping.recent.tagged_with(tag_array).page(params[:page]).per(10)
@posts, @photos, @users = [], [], []
else
@clippings, @posts, @photos, @users = [], [], [], []
end
else
- @posts = Post.recent.limit(5).tagged_with(tag_names, :match_all => true)
- @photos = Photo.recent.limit(10).tagged_with(tag_names, :match_all => true)
- @users = User.recent.limit(10).tagged_with(tag_names, :match_all => true)
- @clippings = Clipping.recent.limit(10).tagged_with(tag_names, :match_all => true)
+ @posts = Post.recent.limit(5).tagged_with(tag_array)
+ @photos = Photo.recent.limit(10).tagged_with(tag_array)
+ @users = User.recent.limit(10).tagged_with(tag_array)
+ @clippings = Clipping.recent.limit(10).tagged_with(tag_array)
end
end
@@ -2,7 +2,7 @@
# Methods added to this helper will be available to all templates in the application.
module BaseHelper
- include TagsHelper
+ include ActsAsTaggableOn::TagsHelper
def commentable_url(comment)
if comment.commentable_type != "User"
@@ -0,0 +1,72 @@
+require_dependency ActsAsTaggableOn::Engine.config.root.join('app', 'models', 'acts_as_taggable_on', 'tag.rb').to_s
+
+class ActsAsTaggableOn::Tag < ActiveRecord::Base
+
+ class << self
+ def popular(limit = 20, type = nil)
+ tags = ActsAsTaggableOn::Tag.counts(:at_least => 0).limit(limit).order('count DESC')
+ tags = tags.where("taggings.taggable_type = ?", type.capitalize) if type
+ tags
+ end
+
+ def default_per_page
+ 25
+ end
+
+ # Calculate the tag counts for all tags.
+ #
+ # - +:start_at+ - restrict the tags to those created after a certain time
+ # - +:end_at+ - restrict the tags to those created before a certain time
+ # - +:at_least+ - exclude tags with a frequency less than the given value
+ # - +:at_most+ - exclude tags with a frequency greater than the given value
+ #
+ # Deprecated:
+ #
+ # - +:conditions+
+ # - +:limit+
+ # - +:order+
+ #
+ def counts(options = {})
+ options.assert_valid_keys :start_at, :end_at, :at_least, :at_most, :conditions, :limit, :order, :joins
+
+ tags = joins(:taggings)
+ tags = tags.having(['count >= ?', options[:at_least]]) if options[:at_least]
+ tags = tags.having(['count <= ?', options[:at_most]]) if options[:at_most]
+ tags = tags.where("#{ActsAsTaggableOn::Tagging.quoted_table_name}.created_at >= ?", options[:start_at]) if options[:start_at]
+ tags = tags.where("#{ActsAsTaggableOn::Tagging.quoted_table_name}.created_at <= ?", options[:end_at]) if options[:end_at]
+
+ # TODO: deprecation warning
+ tags = tags.where(options[:conditions]) if options[:conditions]
+ tags = tags.limit(options[:limit]) if options[:limit]
+ tags = tags.order(options[:order]) if options[:order]
+
+ if joins = options.delete(:joins)
+ tags = tags.joins(joins)
+ end
+
+ tags.select("#{quoted_table_name}.id, #{quoted_table_name}.name, COUNT(#{quoted_table_name}.id) AS count").group("#{quoted_table_name}.id, #{quoted_table_name}.name")
+ end
+
+
+ end
+
+ def to_param
+ URI.escape(URI.escape(self.name), /[\/.?#]/)
+ end
+
+ def related_tags(limit = 10)
+ taggables = self.taggings.limit(10).all.collect{|t| t.taggable }
+ tagging_ids = taggables.map{|t| t.taggings.limit(10).map(&:id) }.flatten.uniq
+ return [] if tagging_ids.blank?
+
+ ActsAsTaggableOn::Tag.where("tags.id != '#{self.id}'").
+ select("tags.id, tags.name, COUNT(tags.id) as count").
+ joins(:taggings).
+ where({:taggings => {:id => tagging_ids }}).
+ group("tags.id, tags.name").
+ order("count DESC").
+ limit(limit)
+ end
+
+end
+
View
@@ -26,7 +26,10 @@ def self.find_related_to(clipping, options = {})
:conditions => [ 'clippings.id != ?', clipping.id ]
})
- limit(options[:limit]).order(options[:order]).where(options[:conditions]).tagged_with(clipping.tags.collect{|t| t.name })
+ limit(options[:limit]).
+ order(options[:order]).
+ where(options[:conditions]).
+ tagged_with(clipping.tags.collect{|t| t.name }, :any => true)
end
def self.find_recent(options = {:limit => 5})
View
@@ -62,7 +62,7 @@ def self.find_related_to(photo, options = {})
:order => 'created_at DESC',
:conditions => ['photos.id != ?', photo.id]
})
- limit(options[:limit]).order(options[:order]).where(options[:conditions]).tagged_with(photo.tags.collect{|t| t.name })
+ limit(options[:limit]).order(options[:order]).where(options[:conditions]).tagged_with(photo.tags.collect{|t| t.name }, :any => true)
end
def cropping?
View
@@ -56,7 +56,7 @@ def find_related_to(post, options = {})
:conditions => [ 'posts.id != ? AND published_as = ?', post.id, 'live' ]
})
- limit(options[:limit]).order(options[:order]).where(options[:conditions]).tagged_with(post.tag_list)
+ limit(options[:limit]).order(options[:order]).where(options[:conditions]).tagged_with(post.tag_list, :any => true)
end
def find_recent(options = {:limit => 5})
View
@@ -1,36 +0,0 @@
-require_dependency ActsAsTaggable::Engine.config.root.join('app', 'models', 'tag.rb').to_s
-
-class Tag < ActiveRecord::Base
-
- class << self
- def popular(limit = 20, type = nil)
- tags = Tag.counts(:at_least => 0).limit(limit).order('count DESC')
- tags = tags.where("taggings.taggable_type = ?", type.capitalize) if type
- tags
- end
-
- def default_per_page
- 25
- end
- end
-
- def to_param
- URI.escape(URI.escape(self.name), /[\/.?#]/)
- end
-
- def related_tags(limit = 10)
- taggables = self.taggings.limit(10).all.collect{|t| t.taggable }
- tagging_ids = taggables.map{|t| t.taggings.limit(10).map(&:id) }.flatten.uniq
- return [] if tagging_ids.blank?
-
- Tag.where("tags.id != '#{self.id}'").
- select("tags.id, tags.name, COUNT(tags.id) as count").
- joins(:taggings).
- where({:taggings => {:id => tagging_ids }}).
- group("tags.id, tags.name").
- order("count DESC").
- limit(limit)
- end
-
-end
-
View
@@ -371,7 +371,7 @@ def friends_ids
def recommended_posts(since = 1.week.ago)
return [] if tags.empty?
- rec_posts = Post.tagged_with(tags.map(&:name)).where(['posts.user_id != ? AND published_at > ?', self.id, since ])
+ rec_posts = Post.tagged_with(tags.map(&:name), :any => true).where(['posts.user_id != ? AND published_at > ?', self.id, since ])
rec_posts = rec_posts.order('published_at DESC').limit(10)
rec_posts
end
@@ -11,6 +11,6 @@
-box do
%h3= :tags.l
- tag_cloud @popular_tags, %w(nube1 nube2 nube3 nube4 nube5) do |tag, css_class|
- = link_to tag.name, tag_path(tag.to_param), :class => css_class
+ = link_to ActsAsTaggableOn::Tag.name, tag_path(ActsAsTaggableOn::Tag.to_param), :class => css_class
%h6.all=link_to :all_tags.l, tags_path
@@ -73,7 +73,7 @@
%h6.all.right= link_to :log_in_to_create_a_new_topic.l, new_forum_topic_path(@forum)
- if @topics.size < 10
- - @related = Post.limit(10).tagged_with(@forum.tag_list)
+ - @related = Post.limit(10).tagged_with(@forum.tag_list, :any => true)
- unless @related.empty?
%table.wide.topics{:border=>"0", :cellspacing=>"0", :cellpadding=>"0"}
%tr
@@ -6,10 +6,10 @@
%ul.tags
- @tags.each do |tag|
%li
- - if (tag.name.eql?(params[:tag_name]) )
- = link_to tag.name, user_photos_path(@user), :class => "selected"
+ - if (ActsAsTaggableOn::Tag.name.eql?(params[:tag_name]) )
+ = link_to ActsAsTaggableOn::Tag.name, user_photos_path(@user), :class => "selected"
- else
- = link_to tag.name, user_photos_path(:user_id => @user, :tag_name => tag.name)
+ = link_to ActsAsTaggableOn::Tag.name, user_photos_path(:user_id => @user, :tag_name => ActsAsTaggableOn::Tag.name)
#yui-main
@@ -9,5 +9,5 @@
-box do
%h3=:tags.l
- tag_cloud @popular_tags, %w(nube1 nube2 nube3 nube4 nube5) do |tag, css_class|
- = link_to tag.name, tag_path(tag.to_param), :class => css_class
+ = link_to ActsAsTaggableOn::Tag.name, tag_path(ActsAsTaggableOn::Tag.to_param), :class => css_class
%h6.all=link_to :all_tags.l, tags_path
@@ -3,7 +3,7 @@
#yui-main
-box :class => "yui-b" do
- %h3=:editing_tag.l
+ %h3=:editing_ActsAsTaggableOn::Tag.l
= form_for(:tag, :url => tag_path(@tag), :html => { :method => :put, :class => "MainForm" }) do |f|
%label
@@ -22,4 +22,4 @@
-box do
%h3= :browse_content_by_tags.l
-tag_cloud @tags, %w(css1 css2 css3 css4) do |tag, css_class|
- =link_to tag.name, tag_url(tag.to_param), :class => css_class
+ =link_to ActsAsTaggableOn::Tag.name, tag_url(ActsAsTaggableOn::Tag.to_param), :class => css_class
@@ -3,7 +3,7 @@
-box do
%h3=:search.l
- = form_for @search, :html => {:class => "MainForm"} do |f|
+ = form_for @search, :url => tags_path, :html => {:class => "MainForm"} do |f|
= f.label :name.l
= f.text_field :name_starts_with
@@ -7,13 +7,13 @@
- else
= :items_tagged.l
- @tags.each do |tag|
- = link_to h(tag.name), tag_path(tag)
+ = link_to h(ActsAsTaggableOn::Tag.name), tag_path(tag)
-if @related_tags.to_a.size > 0
-box do
%h3.tags=:related_tags.l
-tag_cloud @related_tags, %w(css1 css2 css3 css4) do |tag, css_class|
- =link_to h(tag.name), tag_path(tag), :class => css_class
+ =link_to h(ActsAsTaggableOn::Tag.name), tag_path(tag), :class => css_class
%h6.all= link_to :all_tags.l, tags_path
View
@@ -49,6 +49,6 @@ Gem::Specification.new do |s|
s.add_dependency(%q<meta_search>, ["= 1.1.1"])
s.add_dependency(%q<koala>, [">= 0"])
s.add_dependency(%q<tinymce-rails>, ["~> 3.4.7"])
- s.add_dependency(%q<bborn-acts_as_taggable_on_steroids>, ["~> 2.1"])
+ s.add_dependency(%q<acts-as-taggable-on>, ['~> 2.2.1'])
end
@@ -0,0 +1,16 @@
+class MigrateToActsAsTaggableOn < ActiveRecord::Migration
+
+ def self.change
+
+ change_table :taggings do |t|
+ t.references :tagger, :polymorphic => true
+ t.string :context, :limit => 128
+ t.datetime :created_at
+ end
+
+ add_index :taggings, :tag_id
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
+ end
+
+
+end
Oops, something went wrong.

0 comments on commit d717b2d

Please sign in to comment.