summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/development_init.rake21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/tasks/development_init.rake b/lib/tasks/development_init.rake
index 22553fc..d3c8aff 100644
--- a/lib/tasks/development_init.rake
+++ b/lib/tasks/development_init.rake
@@ -58,4 +58,25 @@ namespace :cccms do
58 58
59 n.publish_draft! 59 n.publish_draft!
60 end 60 end
61
62 desc "Convert Entities to real charactes"
63 task :convert_entities => :environment do |t|
64 Page.all.each do |page|
65 if page.body
66 puts ">> #{page.id} -- #{page.node.unique_name if page.node}"
67 tmp_body = page.body.dup
68 tmp_body.gsub!(/ä/, "ä")
69 tmp_body.gsub!(/ö/, "ö")
70 tmp_body.gsub!(/ü/, "ü")
71 tmp_body.gsub!(/Ä/, "ä")
72 tmp_body.gsub!(/Ö/, "ö")
73 tmp_body.gsub!(/Ü/, "ü")
74 tmp_body.gsub!(/ß/, "ß")
75 tmp_body.gsub!(/ /, " ")
76 tmp_body.gsub!(/–/, "–")
77 page.body = tmp_body
78 page.save
79 end
80 end
81 end
61end \ No newline at end of file 82end \ No newline at end of file