Sha256: a8b04ae25f43bf90466fe9f4116d6864438ddc6dd7e7dd8d7342dbf02dd15ccb
Contents?: true
Size: 498 Bytes
Versions: 1
Compression:
Stored size: 498 Bytes
Contents
desc "Sends old posts (comments with project_update true) to tumblr" task :send_old_posts_to_tumblr => :environment do # Redefines the model class Comment < ActiveRecord::Base scope :posts, where("project_update") belongs_to :project, foreign_key: :commentable_id end Comment.posts.each do |post| Tumblr::Post.create(TumblrUser, group: Catarse::Configuration[:tumblr_blog], title: post.title, body: post.comment, date: post.created_at, tags: post.project.to_param) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
catarse_core-1.0.0.beta | lib/tasks/send_old_posts_to_tumblr.rake |