Skip to content

Commit

Permalink
It is a good idea (need more sleep), more to come
Browse files Browse the repository at this point in the history
  • Loading branch information
friflaj committed Sep 25, 2010
1 parent 7659644 commit bd81de4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions db/migrate/012_scrub_body.rb
Expand Up @@ -15,6 +15,17 @@ def self.up
}
end

contexts = Project.find(:all).collect{|p| p.identifier}
contexts << contexts.collect{|c| c.gsub('-', '_')}
contexts.flatten!

ActsAsTaggableOn::Tag.find(:all,
:conditions => ["not name like '#%' and id in (select tag_id from taggings where taggable_type in ('WikiPage', 'Issue') and context in (?))", contexts]
).each {|tag|
tag.name = "##{tag.name}"
tag.save
}

def self.down
end
end
Expand Down

0 comments on commit bd81de4

Please sign in to comment.