Skip to content

Instantly share code, notes, and snippets.

@twoism
Forked from maurcs/gist:285982
Created January 25, 2010 16:20
Show Gist options
  • Save twoism/285985 to your computer and use it in GitHub Desktop.
Save twoism/285985 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