acts-as-taggable-on 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.7
1
+ 1.1.8
@@ -43,6 +43,10 @@ module ActiveRecord
43
43
  def #{tag_type.singularize}_list
44
44
  tag_list_on('#{tag_type}')
45
45
  end
46
+
47
+ def all_#{tag_type}_list
48
+ all_tags_list_on('#{tag_type}')
49
+ end
46
50
 
47
51
  def #{tag_type.singularize}_list=(new_tags)
48
52
  set_tag_list_on('#{tag_type}',new_tags)
@@ -48,6 +48,10 @@ describe "Acts As Taggable On" do
48
48
  @taggable.should respond_to(:tag_list, :skill_list, :language_list)
49
49
  @taggable.should respond_to(:tag_list=, :skill_list=, :language_list=)
50
50
  end
51
+
52
+ it "should generate a tag_list accessor for getting all tags for each tag type" do
53
+ @taggable.should respond_to(:all_tags_list, :all_skills_list, :all_languages_list)
54
+ end
51
55
  end
52
56
 
53
57
  describe "Single Table Inheritance" do
@@ -33,6 +33,22 @@ describe "Tagger" do
33
33
  @taggable.all_tags_list_on(:tags).sort.should == %w(ruby scheme java python lisp).sort
34
34
  @taggable.all_tags_on(:tags).size.should == 6
35
35
  end
36
+
37
+ it "should not lose tags" do
38
+ @taggable.update_attributes(:tag_list => 'ruby')
39
+ @user.tag(@taggable, :with => 'ruby, scheme', :on => :tags)
40
+
41
+ [@taggable, @user].each(&:reload)
42
+ @taggable.tag_list.should == %w(ruby)
43
+ @taggable.all_tags_list.sort.should == %w(ruby scheme).sort
44
+
45
+ lambda {
46
+ @taggable.update_attributes(:tag_list => "")
47
+ }.should change(Tagging, :count).by(-1)
48
+
49
+ @taggable.tag_list.should == []
50
+ @taggable.all_tags_list.sort.should == %w(ruby scheme).sort
51
+ end
36
52
 
37
53
  it "is tagger" do
38
54
  @user.is_tagger?.should(be_true)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 7
9
- version: 1.1.7
8
+ - 8
9
+ version: 1.1.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Bleigh
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-08 00:00:00 +01:00
17
+ date: 2010-03-22 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies: []
20
20