Skip to content

Commit

Permalink
Remove user resource. Add ssh url to repo for project
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Jun 3, 2013
1 parent 26938bf commit 94ae273
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 135 deletions.
3 changes: 2 additions & 1 deletion app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def add
name: project.name_with_namespace,
gitlab_url: project.web_url,
scripts: 'ls -la',
default_ref: project.default_branch
default_ref: project.default_branch,
ssh_url_to_repo: project.ssh_url_to_repo
}

@project = Project.new(params)
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/resques_controller.rb

This file was deleted.

40 changes: 0 additions & 40 deletions app/controllers/users_controller.rb

This file was deleted.

6 changes: 4 additions & 2 deletions app/models/project.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
class Project < ActiveRecord::Base
attr_accessible :name, :path, :scripts, :timeout, :token,
:default_ref, :gitlab_url, :always_build, :polling_interval, :public
:default_ref, :gitlab_url, :always_build, :polling_interval,
:public, :ssh_url_to_repo

has_many :builds, dependent: :destroy


#
# Validations
#
validates_presence_of :name, :scripts, :timeout, :token, :default_ref, :gitlab_url
validates_presence_of :name, :scripts, :timeout, :token, :default_ref, :gitlab_url, :ssh_url_to_repo

validates_uniqueness_of :name

validates :polling_interval,
Expand Down
3 changes: 3 additions & 0 deletions app/views/projects/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
.field
= f.label :gitlab_url, "GitLab url to project"
= f.text_field :gitlab_url, class: 'input-xlarge', placeholder: 'http://gitlab.domain.com/project-slug'
.field
= f.label :ssh_url_to_repo, "ssh url to repository"
= f.text_field :ssh_url_to_repo, class: 'input-xlarge', placeholder: 'git@gitlab.domain.com:project-slug.git'
.field
= f.label :default_ref, "Make tabs for next branches"
= f.text_field :default_ref, class: 'input-xlarge', placeholder: 'master, stable'
Expand Down
25 changes: 0 additions & 25 deletions app/views/users/edit.html.haml

This file was deleted.

24 changes: 0 additions & 24 deletions app/views/users/edit.html.haml~

This file was deleted.

35 changes: 0 additions & 35 deletions app/views/users/index.html.haml

This file was deleted.

1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
end
end

resources :users
resource :user_sessions
resources :runners, only: [:index, :destroy]

Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20130603144030_add_more_fields_to_project.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddMoreFieldsToProject < ActiveRecord::Migration
def change
add_column :projects, :ssh_url_to_repo, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20130603130920) do
ActiveRecord::Schema.define(:version => 20130603144030) do

create_table "builds", :force => true do |t|
t.integer "project_id"
Expand Down Expand Up @@ -41,6 +41,7 @@
t.boolean "always_build", :default => false, :null => false
t.integer "polling_interval"
t.boolean "public", :default => false, :null => false
t.string "ssh_url_to_repo"
end

create_table "runners", :force => true do |t|
Expand Down

0 comments on commit 94ae273

Please sign in to comment.