diff --git a/app/controllers/manage_tags_controller.rb b/app/controllers/manage_tags_controller.rb index 193c0ed..67e2bb5 100644 --- a/app/controllers/manage_tags_controller.rb +++ b/app/controllers/manage_tags_controller.rb @@ -35,7 +35,7 @@ class ManageTagsController < ApplicationController # Prompt for modifications on the attributes of a tag def edit @tag = Tag.find_with_pendings(params[:id]) - @parent_tags = @tag.parents_candidates + @parent_tags = @tag.parent_candidates end # Do the modifications collected by edit @@ -45,7 +45,7 @@ class ManageTagsController < ApplicationController flash[:notice] = _('Tag was successfully updated.') redirect_to :action => 'list' else - @parent_tags = @tag.parents_candidates + @parent_tags = @tag.parent_candidates render :action => 'edit' end end diff --git a/db/migrate/004_acts_as_taggable_migration.rb b/db/migrate/004_acts_as_taggable_migration.rb index 5911558..85d4a5d 100644 --- a/db/migrate/004_acts_as_taggable_migration.rb +++ b/db/migrate/004_acts_as_taggable_migration.rb @@ -3,7 +3,7 @@ class ActsAsTaggableMigration < ActiveRecord::Migration create_table :tags do |t| t.column :name, :string t.column :parent_id, :integer - t.column :pending, :boolean + t.column :pending, :boolean, :default => false end create_table :taggings do |t| diff --git a/lib/extended_tag.rb b/lib/extended_tag.rb index 626cd40..0ace057 100644 --- a/lib/extended_tag.rb +++ b/lib/extended_tag.rb @@ -17,7 +17,7 @@ class Tag end # All the tags that can be a new parent for this tag, that is all but itself and its descendents to avoid loops - def parents_candidates + def parent_candidates Tag.find(:all) - descendents - [self] end @@ -26,9 +26,4 @@ class Tag children.to_a.sum([], &:descendents) + children end - # Test if this tag has been approved already - def aproved? - not pending? - end - end diff --git a/test/functional/manage_tags_controller_test.rb b/test/functional/manage_tags_controller_test.rb index 4e2aff6..effbf93 100644 --- a/test/functional/manage_tags_controller_test.rb +++ b/test/functional/manage_tags_controller_test.rb @@ -6,12 +6,8 @@ class ManageTagsController; def rescue_action(e) raise e end; end class ManageTagsControllerTest < Test::Unit::TestCase - def test_truth - assert true - end + fixtures :tags -#TODO i comment it because the test were not passing - fixtures :tags, :users, :blocks, :profiles, :virtual_communities, :boxes, :domains def setup @controller = ManageTagsController.new @request = ActionController::TestRequest.new -- libgit2 0.21.2