Sha256: 1320d2c0143970c3921925d52bb4f2e46f0c0ab38996aaeaf28bb7c48a538f15

Contents?: true

Size: 338 Bytes

Versions: 8

Compression:

Stored size: 338 Bytes

Contents

# desc "Explaining what the task does"
# task :spud_blog do
#   # Task goes here
# end

namespace :tb_blog do

  task apply_blog_keys: :environment do
    SpudPost.all.each do |post|
      if post.is_news?
        post.update_column(:blog_key, 'news')
      else
        post.update_column(:blog_key, 'blog')
      end
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tb_blog-1.4.4 lib/tasks/spud_blog_tasks.rake
tb_blog-1.4.3 lib/tasks/spud_blog_tasks.rake
tb_blog-1.4.2 lib/tasks/spud_blog_tasks.rake
tb_blog-1.3.5 lib/tasks/spud_blog_tasks.rake
tb_blog-1.4.1 lib/tasks/spud_blog_tasks.rake
tb_blog-1.4.0 lib/tasks/spud_blog_tasks.rake
tb_blog-1.3.4 lib/tasks/spud_blog_tasks.rake
tb_blog-1.4.beta1 lib/tasks/spud_blog_tasks.rake