Merge branch 'master' of github.com:warpc/rosa-build
This commit is contained in:
commit
2926cc6309
1
Rakefile
1
Rakefile
|
@ -3,5 +3,6 @@
|
|||
|
||||
require File.expand_path('../config/application', __FILE__)
|
||||
require 'rake'
|
||||
require 'airbrake/tasks'
|
||||
|
||||
Rosa::Application.load_tasks
|
||||
|
|
|
@ -12,6 +12,7 @@ module PersonalRepository
|
|||
pl.name = "#{self.uname}_personal"
|
||||
pl.unixname = "#{self.uname}_personal"
|
||||
pl.platform_type = 'personal'
|
||||
pl.distrib_type = 'mandriva2011'
|
||||
pl.save
|
||||
|
||||
rep = pl.repositories.build
|
||||
|
|
|
@ -23,7 +23,7 @@ class User < ActiveRecord::Base
|
|||
include PersonalRepository
|
||||
|
||||
validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /^[a-zA-Z0-9_]+$/ }, :allow_nil => false, :allow_blank => false
|
||||
validates :ssh_key, :uniqueness => true
|
||||
validates :ssh_key, :uniqueness => true, :allow_blank => true
|
||||
validate { errors.add(:uname, :taken) if Group.where('uname LIKE ?', uname).present? }
|
||||
#TODO: Replace this simple cross-table uniq validation by more progressive analog
|
||||
validate lambda {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,8 +1 @@
|
|||
APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env]
|
||||
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue