summaryrefslogtreecommitdiff
path: root/lib/tasks/development_init.rake
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-11-11 17:49:54 +0100
committerhukl <contact@smyck.org>2009-11-11 17:49:54 +0100
commit4e91b01a1c29bad11b569a82f78b7e42b8f320e2 (patch)
treeda467896dd5da302ce62de4c22a3e65289f07a3e /lib/tasks/development_init.rake
parentd206eb893c5a526aa97dde3b9c0dd9563e222386 (diff)
added rake task to remove orphan pages (pages without a node)
Diffstat (limited to 'lib/tasks/development_init.rake')
-rw-r--r--lib/tasks/development_init.rake7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tasks/development_init.rake b/lib/tasks/development_init.rake
index e503728..c8fa469 100644
--- a/lib/tasks/development_init.rake
+++ b/lib/tasks/development_init.rake
@@ -109,4 +109,11 @@ namespace :cccms do
109 p.save! 109 p.save!
110 end 110 end
111 end 111 end
112
113 desc "Remove pages without a node"
114 task :remove_orphans => :environment do |t|
115 orphans = Page.all.select { |x| x.node == nil }
116 orphans.each { |page| page.destroy }
117 end
118
112end \ No newline at end of file 119end \ No newline at end of file