module DK::TQueue
Public Instance Methods
move_to_drafts(options)
click to toggle source
Move from Queue to Drafts @param options [String] Move posts not containing :key_text @return [Int] Number of modified posts
# File lib/draftking/queue.rb, line 7 def move_to_drafts(options) options[:message] = 'Moving Queue ~> Drafts: ' options[:shuffle] = false options[:state] = DK::DRAFT options[:source] ||= DK::QUEUE post_operation(options) do |post, _| post.changed = !post.has_key_text?(@key_text) post.change_state(@state) if post.changed end end