This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :clean do | |
task :snags => :environment do | |
Location.all.each do |loc| | |
@pages = loc.website.web_page_templates | |
@pages.each do |i| | |
i.update_attribute(:parent_id, nil) if i.parent_id? | |
end | |
nav_id = (GardenWidget.find_by name: "Navigation").id | |
@nav_setting = (loc.website.widgets.find_by garden_widget_id: nav_id).navigation.object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
NewerOlder