lib/tasks/georgia.rake in georgia-0.7.1 vs lib/tasks/georgia.rake in georgia-0.7.2

- old
+ new

@@ -1,47 +1,15 @@ namespace :georgia do - namespace :migrate do - - desc "Saves ancestry from legacy parent_id" - task ancestry: :environment do - - Georgia::Page.find_each do |page| - if parent = page.attributes['parent_id'] - begin - page.parent = Georgia::Page.find(parent) - page.save! - rescue ActiveRecord::RecordNotFound - puts 'Page not found' - end - end - end - + desc "Creates an Admin user to get started" + task seed: :environment do + first_name = ask("First name:") + last_name = ask("Last name:") + email = ask("Email:") + password = ask("Password:") + Georgia::User.create(first_name: first_name, last_name: last_name, email: email, password: password, password_confirmation: password) do |user| + user.roles << Georgia::Role.all end - - desc "Saves keywords to tags list" - task tags: :environment do - - Georgia::Content.find_each do |content| - content.keyword_list = content.keywords - content.save - end - - end - end - - desc "Purge assets that don't have an existing file in the cloud" - task purge: :environment do - count = 0 - Ckeditor::Asset.find_each do |asset| - begin - if !asset.data.file.exists? - asset.destroy - count += 1 - end - end - end - puts "#{count} assets purged." end namespace :messages do desc "Send to Akismet all unverified messages" \ No newline at end of file