Skip to content

Instantly share code, notes, and snippets.

@moskvin
Created April 2, 2012 14:38
Show Gist options
  • Save moskvin/2283919 to your computer and use it in GitHub Desktop.
Save moskvin/2283919 to your computer and use it in GitHub Desktop.
Fix for postgres connection via redis
------------------------- app/workers/post_receive.rb -------------------------
index 28216ec..39ead22 100644
@@ -2,6 +2,9 @@ class PostReceive
@queue = :post_receive
def self.perform(reponame, oldrev, newrev, ref, author_key_id)
+
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
+
project = Project.find_by_path(reponame)
return false if project.nil?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment