DEV: Allow rebaking oncooked posts of single site
This commit is contained in:
parent
4fe885dedf
commit
fb121815a5
|
@ -8,7 +8,16 @@ task 'posts:rebake' => :environment do
|
|||
end
|
||||
|
||||
task 'posts:rebake_uncooked_posts' => :environment do
|
||||
RailsMultisite::ConnectionManagement.each_connection do
|
||||
ENV['RAILS_DB'] ? rebake_uncooked_posts : rebake_uncooked_posts_all_sites
|
||||
end
|
||||
|
||||
def rebake_uncooked_posts_all_sites
|
||||
RailsMultisite::ConnectionManagement.each_connection do |db|
|
||||
rebake_uncooked_posts
|
||||
end
|
||||
end
|
||||
|
||||
def rebake_uncooked_posts
|
||||
puts "Rebaking uncooked posts on #{RailsMultisite::ConnectionManagement.current_db}"
|
||||
uncooked = Post.where('baked_version <> ? or baked_version IS NULL', Post::BAKED_VERSION)
|
||||
|
||||
|
@ -22,7 +31,6 @@ task 'posts:rebake_uncooked_posts' => :environment do
|
|||
|
||||
puts "", "#{rebaked} posts done!", ""
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Update each post with latest markdown and refresh oneboxes'
|
||||
task 'posts:refresh_oneboxes' => :environment do
|
||||
|
|
Loading…
Reference in New Issue