Redo with_ga include trying to fix strange production bug. Refs #2136

This commit is contained in:
Pavel Chipiga 2011-10-27 22:23:31 +03:00
parent 1277e81336
commit 8fadbfbd66
4 changed files with 12 additions and 13 deletions

View File

@ -12,7 +12,7 @@
%a{:href => "/"}= t("layout.global_header")
#user-navigation
%ul.wat-cf
%li= link_to current_user.uname, edit_user_path(current_user)
%li= link_to current_user.uname, edit_user_registration_path
%li= link_to t('layout.logout'), destroy_user_session_path, :method => :delete, :class => "logout"
#main-navigation
%ul.wat-cf

View File

@ -1,10 +1 @@
APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env]
class Object
def with_ga(&block)
Gitolito::GitoliteAdmin.thread_safe(File.join(APP_CONFIG['root_path'], 'gitolite-admin'), {:wait_lock => true, :seconds => 5}) do |ga|
block.call(ga)
end
# ga = Gitolito::GitoliteAdmin.new File.join(APP_CONFIG['root_path'], 'gitolite-admin'); block.call(ga)
end
end

View File

@ -208,7 +208,6 @@ ActiveRecord::Schema.define(:version => 20111026200223) 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"
end
@ -271,9 +270,8 @@ ActiveRecord::Schema.define(:version => 20111026200223) do
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.integer "global_role_id"
end

View File

@ -0,0 +1,10 @@
require 'gitolito'
class Object
def with_ga(&block)
::Gitolito::GitoliteAdmin.thread_safe(File.join(APP_CONFIG['root_path'], 'gitolite-admin'), {:wait_lock => true, :seconds => 5}) do |ga|
block.call(ga)
end
# ga = Gitolito::GitoliteAdmin.new File.join(APP_CONFIG['root_path'], 'gitolite-admin'); block.call(ga)
end
end