BigW Consortium Gitlab

Commit e5ff5c28 by Dmitriy Zaporozhets

Use project with namespace in email subject

parent 30d63707
...@@ -154,6 +154,6 @@ class Notify < ActionMailer::Base ...@@ -154,6 +154,6 @@ class Notify < ActionMailer::Base
# >> subject('Lorem ipsum', 'Dolor sit amet') # >> subject('Lorem ipsum', 'Dolor sit amet')
# => "GitLab | Lorem ipsum | Dolor sit amet" # => "GitLab | Lorem ipsum | Dolor sit amet"
def subject(*extra) def subject(*extra)
"GitLab | " << extra.join(' | ') << (@project ? " | #{@project.name}" : "") "GitLab | " << extra.join(' | ') << (@project ? " | #{@project.name_with_namespace}" : "")
end end
end end
...@@ -17,14 +17,14 @@ module Gitlab ...@@ -17,14 +17,14 @@ module Gitlab
@commits = collect_commits @commits = collect_commits
@days = index_commits @days = index_commits
end end
def to_json(*args) def to_json(*args)
{ {
days: @days.compact.map { |d| [d.day, d.strftime("%b")] }, days: @days.compact.map { |d| [d.day, d.strftime("%b")] },
commits: @commits.map(&:to_graph_hash) commits: @commits.map(&:to_graph_hash)
}.to_json(*args) }.to_json(*args)
end end
protected protected
# Get commits from repository # Get commits from repository
......
...@@ -118,10 +118,10 @@ namespace :gitlab do ...@@ -118,10 +118,10 @@ namespace :gitlab do
task :create => :environment do task :create => :environment do
backup_path_repo = File.join(Gitlab.config.backup.path, "repositories") backup_path_repo = File.join(Gitlab.config.backup.path, "repositories")
FileUtils.mkdir_p(backup_path_repo) until Dir.exists?(backup_path_repo) FileUtils.mkdir_p(backup_path_repo) until Dir.exists?(backup_path_repo)
puts "Dumping repositories ..." puts "Dumping repositories ...".blue
Project.find_each(:batch_size => 1000) do |project| Project.find_each(:batch_size => 1000) do |project|
print "#{project.path_with_namespace} ... " print " * #{project.path_with_namespace} ... "
if project.empty_repo? if project.empty_repo?
puts "[SKIPPED]".cyan puts "[SKIPPED]".cyan
...@@ -174,9 +174,9 @@ namespace :gitlab do ...@@ -174,9 +174,9 @@ namespace :gitlab do
backup_path_db = File.join(Gitlab.config.backup.path, "db") backup_path_db = File.join(Gitlab.config.backup.path, "db")
FileUtils.mkdir_p(backup_path_db) unless Dir.exists?(backup_path_db) FileUtils.mkdir_p(backup_path_db) unless Dir.exists?(backup_path_db)
puts "Dumping database tables ... " puts "Dumping database tables ... ".blue
ActiveRecord::Base.connection.tables.each do |tbl| ActiveRecord::Base.connection.tables.each do |tbl|
print "#{tbl.yellow} ... " print " * #{tbl.yellow} ... "
count = 1 count = 1
File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file| File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file|
ActiveRecord::Base.connection.select_all("SELECT * FROM `#{tbl}`").each do |line| ActiveRecord::Base.connection.select_all("SELECT * FROM `#{tbl}`").each do |line|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment