This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
true \ | |
&& sudo apt-get update -qq \ | |
&& sudo apt-get -qq -y install curl apt-transport-https ca-certificates software-properties-common \ | |
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - \ | |
&& sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ | |
&& sudo apt-get update -qq \ | |
&& sudo apt-get install docker-ce \ | |
&& sudo apt-get clean | |
# Install Docker Machine V0.15.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'uri' | |
require 'addressable/uri' | |
module SiteUrlHelper | |
def self.site_url_valid? url | |
uri = URI.parse url | |
uri.kind_of? URI::HTTP | |
rescue URI::InvalidURIError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'resque/tasks' | |
task "resque:setup" => :environment do | |
ENV['QUEUE'] = '*' | |
Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------- 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/issue.rb b/app/models/issue.rb | |
index ce4944a..9e446ad 100644 | |
--- a/app/models/issue.rb | |
+++ b/app/models/issue.rb | |
@@ -2,6 +2,7 @@ class Issue < ActiveRecord::Base | |
belongs_to :project | |
belongs_to :author, :class_name => "User" | |
belongs_to :assignee, :class_name => "User" | |
+# has_many :notes, :dependent => :destroy, :conditions => ["noteable_id = '?'", 6] | |
has_many :notes, :as => :noteable, :dependent => :destroy |