Skip to content

Instantly share code, notes, and snippets.

@maurcs
Created January 25, 2010 16:19
Show Gist options
  • Save maurcs/285982 to your computer and use it in GitHub Desktop.
Save maurcs/285982 to your computer and use it in GitHub Desktop.
class Post
include MongoMapper::Document
timestamps!
end
# rake task
namespace :tumblr do
desc "import into mongo"
task :import => :environment do
TumblrPost.all(:query=>{:num=>10}).each do |post|
puts post.inspect
Post.create(post.symbolize_keys)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment