Commit db1a53c6297c9dbe4c4555182d76c19c5c1ae597

Authored by Jacob Vosmaer
1 parent 182ced0c

Patch act-as-taggable-on for assets:precompile

config/patches/acts-as-taggable-on-ad02dc9bb24ec8e1e79e7e35e2d4bb5910a66d8e.diff 0 → 100644
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
  1 +diff --git a/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb b/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb
  2 +index 6bec623..5227ddf 100644
  3 +--- a/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb
  4 ++++ b/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb
  5 +@@ -2,7 +2,7 @@ module ActsAsTaggableOn::Taggable
  6 + module Cache
  7 + def self.included(base)
  8 + # Skip adding caching capabilities if table not exists or no cache columns exist
  9 +- return unless base.table_exists? && base.tag_types.any? { |context| base.column_names.include?("cached_#{context.to_s.singularize}_list") }
  10 ++ return unless base.connected? && base.table_exists? && base.tag_types.any? { |context| base.column_names.include?("cached_#{context.to_s.singularize}_list") }
  11 +
  12 + base.send :include, ActsAsTaggableOn::Taggable::Cache::InstanceMethods
  13 + base.extend ActsAsTaggableOn::Taggable::Cache::ClassMethods
config/software/gitlab-core.rb
@@ -36,8 +36,24 @@ build do @@ -36,8 +36,24 @@ build do
36 # source code to include the Git revision of the code included in the omnibus 36 # source code to include the Git revision of the code included in the omnibus
37 # build. 37 # build.
38 command "sed -i 's/.*REVISION.*/REVISION = \"#{version_guid.split(':').last[0,10]}\"/' config/initializers/2_app.rb" 38 command "sed -i 's/.*REVISION.*/REVISION = \"#{version_guid.split(':').last[0,10]}\"/' config/initializers/2_app.rb"
  39 +
39 bundle "install --without mysql development test --path=#{install_dir}/embedded/service/gem" 40 bundle "install --without mysql development test --path=#{install_dir}/embedded/service/gem"
  41 +
  42 + # In order to precompile the assets, we need to get to a state where rake can
  43 + # load the Rails environment.
  44 + command "cp config/gitlab.yml.example config/gitlab.yml"
  45 + command "cp config/database.yml.postgresql config/database.yml"
  46 + # There is a bug in the acts-as-taggable-on gem that makes
  47 + # rake assets:precompile check for a database connection. We do not have a
  48 + # database at this point so that is a problem. This bug is fixed in
  49 + # acts-as-taggable-on 3.0.0 by
  50 + # https://github.com/mbleigh/acts-as-taggable-on/commit/ad02dc9bb24ec8e1e79e7e35e2d4bb5910a66d8e
  51 + command "git apply #{Omnibus.project_root}/config/patches/acts-as-taggable-on-ad02dc9bb24ec8e1e79e7e35e2d4bb5910a66d8e.diff",
  52 + :cwd => "#{install_dir}/embedded/service/gem/ruby/1.9.1/gems/acts-as-taggable-on-2.4.1"
40 rake "assets:precompile", :env => {"RAILS_ENV" => "production"} 53 rake "assets:precompile", :env => {"RAILS_ENV" => "production"}
  54 + # Tear down now that the assets:precompile is done.
  55 + command "rm config/gitlab.yml config/database.yml"
  56 +
41 command "mkdir -p #{install_dir}/embedded/service/gitlab-core" 57 command "mkdir -p #{install_dir}/embedded/service/gitlab-core"
42 command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-core/" 58 command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-core/"
43 block do 59 block do