public
Description: Symbiot's open source documentation system
Clone URL: git://github.com/mando/chronicle.git
Search Repo:
A user can now remove tags from a page :).
mando (author)
Mon May 12 15:32:08 -0700 2008
commit  34a2ed80346cd7c8301eb08fb9116a8e37a7278c
tree    48dc78fd836e8a11a1752bddb574e0c9669ed086
parent  46505a13b92d744c3668cf4c81b7c77c26dfe005
...
1
2
 
3
4
5
6
...
19
20
21
 
 
22
23
24
 
25
26
27
...
1
 
2
3
4
5
6
...
19
20
21
22
23
24
25
 
26
27
28
29
0
@@ -1,5 +1,5 @@
0
 class Page < ActiveRecord::Base
0
- has_many :taggings, :dependent => :nullify
0
+ has_many :taggings, :dependent => :destroy
0
   has_many :tags, :through => :taggings, :uniq => true
0
 
0
   def tag_list
0
0
@@ -19,9 +19,11 @@
0
   end
0
 
0
   def create_taggings(tag_string)
0
+ self.tags.delete(self.tags)
0
+ self.tags.reset
0
     tag_string.split(',').each do |t|
0
       tag = Tag.find_or_create_by_name(t.strip)
0
- self.tags << tag unless self.tags.any? { |existing_tag| existing_tag == tag }
0
+ self.tags << tag
0
     end
0
   end
0
 

Comments

    No one has commented yet.