Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Comatose::Page < ActiveRecord::Base
- end
- desc "load pages"
- task :load_pages_to_db => :environment do
- YAML::add_private_type("Comatose::Page") do |type, value|
- Comatose::Page.new(value)
- end
- dump_yaml = 'comatose_dump.yaml'
- @pages = YAML::load_file( dump_yaml )
- @pages.each do |p|
- Comatose::Page.create(p.attributes)
- end
- end
Add Comment
Please, Sign In to add comment