From c23312ad5160ff6f2aef0d7fce03c7271fed1606 Mon Sep 17 00:00:00 2001 From: Pavel Chipiga Date: Wed, 11 Jan 2012 21:43:33 +0200 Subject: [PATCH] Research and fix problem with build_lists#auto_publish feature. Fix specs. Refs #97 --- app/controllers/build_lists_controller.rb | 2 +- db/schema.rb | 11 +++++------ spec/spec_helper.rb | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/controllers/build_lists_controller.rb b/app/controllers/build_lists_controller.rb index 143ddc880..fc650a4b3 100644 --- a/app/controllers/build_lists_controller.rb +++ b/app/controllers/build_lists_controller.rb @@ -113,7 +113,7 @@ class BuildListsController < ApplicationController @build_list.notified_at = Time.current @build_list.save - @build_list.publish if @build_list.auto_publish # && @build_list.can_publish? + @build_list.delay.publish if @build_list.auto_publish # && @build_list.can_publish? render :nothing => true, :status => 200 end diff --git a/db/schema.rb b/db/schema.rb index c4eb51827..e80b0c134 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -246,7 +246,6 @@ ActiveRecord::Schema.define(:version => 20111228182425) do t.string "object_type" t.integer "target_id" t.string "target_type" - t.integer "role_id" t.datetime "created_at" t.datetime "updated_at" t.string "role" @@ -283,16 +282,16 @@ ActiveRecord::Schema.define(:version => 20111228182425) do create_table "users", :force => true do |t| t.string "name" - t.string "email", :default => "", :null => false - t.string "encrypted_password", :limit => 128, :default => "", :null => false + t.string "email", :default => "", :null => false + t.string "encrypted_password", :limit => 128, :default => "", :null => false + t.string "password_salt", :default => "", :null => false t.string "reset_password_token" - t.datetime "reset_password_sent_at" + t.string "remember_token" t.datetime "remember_created_at" t.datetime "created_at" t.datetime "updated_at" - t.string "uname" t.text "ssh_key" - t.integer "role_id" + t.string "uname" t.string "role" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e15db9c3b..a79b3ce74 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -37,9 +37,9 @@ def stub_rsync_methods any_instance_of(Platform, :umount_directory_for_rsync => true) end +Delayed::Worker.delay_jobs = false # Execute all jobs realtime + # Add testing root_path %x(rm -Rf #{Rails.root}/tmp/test_root) %x(mkdir -p #{Rails.root}/tmp/test_root) APP_CONFIG['root_path'] = "#{Rails.root}/tmp/test_root" - -