public
Rubygem
Description: A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
Homepage: http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
Clone URL: git://github.com/mbleigh/acts-as-taggable-on.git
Click here to lend your support to: acts-as-taggable-on and make a donation at www.pledgie.com !
Applied slainer68's patch, can now add tags directly through the tag list 
without calling set_tag_list_on. [#10 status:resolved]
mbleigh (author)
Tue Jun 10 08:17:45 -0700 2008
commit  1879e96e133ac3f45c7105d204be247c7b933530
tree    3ab276d8a28275a88f22779091175d12bff37984
parent  89bf054dcb370c5b0e342a62d039c4d67f7c76f9
...
207
208
209
 
210
211
212
...
207
208
209
210
211
212
213
0
@@ -207,6 +207,7 @@ module ActiveRecord
0
         
0
         def tag_list_on(context, owner=nil)
0
           var_name = context.to_s.singularize + "_list"
0
+          add_custom_context(context)
0
           return instance_variable_get("@#{var_name}") unless instance_variable_get("@#{var_name}").nil?
0
         
0
           if !owner && self.class.caching_tag_list_on?(context) and !(cached_value = cached_tag_list_on(context, owner)).nil?
...
13
14
15
 
 
 
 
 
 
 
16
17
18
...
13
14
15
16
17
18
19
20
21
22
23
24
25
0
@@ -13,6 +13,13 @@ describe "Taggable" do
0
     Tag.find(:all).size.should == 3
0
   end
0
   
0
+  it "should be able to create tags through the tag list directly" do
0
+    @taggable.tag_list_on(:test).add("hello")
0
+    @taggable.save    
0
+    @taggable.reload
0
+    @taggable.tag_list_on(:test).should == ["hello"]
0
+  end
0
+  
0
   it "should differentiate between contexts" do
0
     @taggable.skill_list = "ruby, rails, css"
0
     @taggable.tag_list = "ruby, bob, charlie"

Comments