summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/event.rb33
-rw-r--r--app/models/group.rb25
-rw-r--r--app/models/issue.rb37
-rw-r--r--app/models/key.rb29
-rw-r--r--app/models/merge_request.rb43
-rw-r--r--app/models/milestone.rb29
-rw-r--r--app/models/note.rb33
-rw-r--r--app/models/project.rb44
-rw-r--r--app/models/project_hook.rb15
-rw-r--r--app/models/protected_branch.rb23
-rw-r--r--app/models/snippet.rb31
-rw-r--r--app/models/system_hook.rb25
-rw-r--r--app/models/user.rb69
-rw-r--r--app/models/users_project.rb25
-rw-r--r--app/models/web_hook.rb25
-rw-r--r--app/models/wiki.rb29
-rw-r--r--app/views/projects/_form.html.haml10
-rw-r--r--db/schema.rb12
-rw-r--r--spec/factories.rb12
-rw-r--r--spec/models/event_spec.rb6
-rw-r--r--spec/models/group_spec.rb12
-rw-r--r--spec/models/issue_spec.rb10
-rw-r--r--spec/models/key_spec.rb6
-rw-r--r--spec/models/merge_request_spec.rb22
-rw-r--r--spec/models/milestone_spec.rb12
-rw-r--r--spec/models/note_spec.rb6
-rw-r--r--spec/models/project_spec.rb17
-rw-r--r--spec/models/protected_branch_spec.rb10
-rw-r--r--spec/models/snippet_spec.rb10
-rw-r--r--spec/models/system_hook_spec.rb8
-rw-r--r--spec/models/user_spec.rb30
-rw-r--r--spec/models/users_project_spec.rb12
-rw-r--r--spec/models/web_hook_spec.rb8
-rw-r--r--spec/models/wiki_spec.rb6
34 files changed, 365 insertions, 359 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index 0ea3224a3b7..2b92783ceac 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -1,3 +1,19 @@
+# == Schema Information
+#
+# Table name: events
+#
+# id :integer not null, primary key
+# target_type :string(255)
+# target_id :integer
+# title :string(255)
+# data :text
+# project_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# action :integer
+# author_id :integer
+#
+
class Event < ActiveRecord::Base
include PushEvent
@@ -144,20 +160,3 @@ class Event < ActiveRecord::Base
end
end
end
-
-# == Schema Information
-#
-# Table name: events
-#
-# id :integer not null, primary key
-# target_type :string(255)
-# target_id :integer
-# title :string(255)
-# data :text
-# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# action :integer
-# author_id :integer
-#
-
diff --git a/app/models/group.rb b/app/models/group.rb
index ef8c7463974..1ff6872f687 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -1,3 +1,15 @@
+# == Schema Information
+#
+# Table name: groups
+#
+# id :integer not null, primary key
+# name :string(255) not null
+# code :string(255) not null
+# owner_id :integer not null
+# created_at :datetime not null
+# updated_at :datetime not null
+#
+
class Group < ActiveRecord::Base
attr_accessible :code, :name, :owner_id
@@ -22,16 +34,3 @@ class Group < ActiveRecord::Base
User.joins(:users_projects).where(users_projects: {project_id: project_ids}).uniq
end
end
-
-# == Schema Information
-#
-# Table name: groups
-#
-# id :integer not null, primary key
-# name :string(255) not null
-# code :string(255) not null
-# owner_id :integer not null
-# created_at :datetime not null
-# updated_at :datetime not null
-#
-
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 1acdfdd3261..1de9d0f9ebc 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1,3 +1,21 @@
+# == Schema Information
+#
+# Table name: issues
+#
+# id :integer not null, primary key
+# title :string(255)
+# assignee_id :integer
+# author_id :integer
+# project_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# closed :boolean default(FALSE), not null
+# position :integer default(0)
+# branch_name :string(255)
+# description :text
+# milestone_id :integer
+#
+
class Issue < ActiveRecord::Base
include IssueCommonality
include Votes
@@ -13,22 +31,3 @@ class Issue < ActiveRecord::Base
opened.assigned(user)
end
end
-
-# == Schema Information
-#
-# Table name: issues
-#
-# id :integer not null, primary key
-# title :string(255)
-# assignee_id :integer
-# author_id :integer
-# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# closed :boolean default(FALSE), not null
-# position :integer default(0)
-# branch_name :string(255)
-# description :text
-# milestone_id :integer
-#
-
diff --git a/app/models/key.rb b/app/models/key.rb
index e4710b85b14..5dac1c1c9fd 100644
--- a/app/models/key.rb
+++ b/app/models/key.rb
@@ -1,3 +1,17 @@
+# == Schema Information
+#
+# Table name: keys
+#
+# id :integer not null, primary key
+# user_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# key :text
+# title :string(255)
+# identifier :string(255)
+# project_id :integer
+#
+
require 'digest/md5'
class Key < ActiveRecord::Base
@@ -67,18 +81,3 @@ class Key < ActiveRecord::Base
Key.where(identifier: identifier).count == 0
end
end
-
-# == Schema Information
-#
-# Table name: keys
-#
-# id :integer not null, primary key
-# user_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# key :text
-# title :string(255)
-# identifier :string(255)
-# project_id :integer
-#
-
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 16e13db7f1a..0766e5baa72 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -1,3 +1,24 @@
+# == Schema Information
+#
+# Table name: merge_requests
+#
+# id :integer not null, primary key
+# target_branch :string(255) not null
+# source_branch :string(255) not null
+# project_id :integer not null
+# author_id :integer
+# assignee_id :integer
+# title :string(255)
+# closed :boolean default(FALSE), not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# st_commits :text(2147483647)
+# st_diffs :text(2147483647)
+# merged :boolean default(FALSE), not null
+# state :integer default(1), not null
+# milestone_id :integer
+#
+
require Rails.root.join("app/models/commit")
require Rails.root.join("app/roles/static_model")
@@ -198,25 +219,3 @@ class MergeRequest < ActiveRecord::Base
Note.where("(noteable_type = 'MergeRequest' AND noteable_id = :mr_id) OR (noteable_type = 'Commit' AND noteable_id IN (:commit_ids))", mr_id: id, commit_ids: commit_ids)
end
end
-
-# == Schema Information
-#
-# Table name: merge_requests
-#
-# id :integer not null, primary key
-# target_branch :string(255) not null
-# source_branch :string(255) not null
-# project_id :integer not null
-# author_id :integer
-# assignee_id :integer
-# title :string(255)
-# closed :boolean default(FALSE), not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# st_commits :text(4294967295
-# st_diffs :text(4294967295
-# merged :boolean default(FALSE), not null
-# state :integer default(1), not null
-# milestone_id :integer
-#
-
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index 1dcc93bf2a4..a50831a2241 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -1,3 +1,17 @@
+# == Schema Information
+#
+# Table name: milestones
+#
+# id :integer not null, primary key
+# title :string(255) not null
+# project_id :integer not null
+# description :text
+# due_date :date
+# closed :boolean default(FALSE), not null
+# created_at :datetime not null
+# updated_at :datetime not null
+#
+
class Milestone < ActiveRecord::Base
attr_accessible :title, :description, :due_date, :closed
@@ -39,18 +53,3 @@ class Milestone < ActiveRecord::Base
"expires at #{due_date.stamp("Aug 21, 2011")}" if due_date
end
end
-
-# == Schema Information
-#
-# Table name: milestones
-#
-# id :integer not null, primary key
-# title :string(255) not null
-# project_id :integer not null
-# description :text
-# due_date :date
-# closed :boolean default(FALSE), not null
-# created_at :datetime not null
-# updated_at :datetime not null
-#
-
diff --git a/app/models/note.rb b/app/models/note.rb
index d7701c3815b..60846e04872 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -1,3 +1,19 @@
+# == Schema Information
+#
+# Table name: notes
+#
+# id :integer not null, primary key
+# note :text
+# noteable_id :string(255)
+# noteable_type :string(255)
+# author_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# project_id :integer
+# attachment :string(255)
+# line_code :string(255)
+#
+
require 'carrierwave/orm/activerecord'
require 'file_size_validator'
@@ -107,20 +123,3 @@ class Note < ActiveRecord::Base
note.start_with?('-1') || note.start_with?(':-1:')
end
end
-
-# == Schema Information
-#
-# Table name: notes
-#
-# id :integer not null, primary key
-# note :text
-# noteable_id :string(255)
-# noteable_type :string(255)
-# author_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# project_id :integer
-# attachment :string(255)
-# line_code :string(255)
-#
-
diff --git a/app/models/project.rb b/app/models/project.rb
index 5b59f227c87..30b534315c5 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1,3 +1,24 @@
+# == Schema Information
+#
+# Table name: projects
+#
+# id :integer not null, primary key
+# name :string(255)
+# path :string(255)
+# description :text
+# created_at :datetime not null
+# updated_at :datetime not null
+# private_flag :boolean default(TRUE), not null
+# code :string(255)
+# owner_id :integer
+# default_branch :string(255)
+# issues_enabled :boolean default(TRUE), not null
+# wall_enabled :boolean default(TRUE), not null
+# merge_requests_enabled :boolean default(TRUE), not null
+# wiki_enabled :boolean default(TRUE), not null
+# group_id :integer
+#
+
require "grit"
class Project < ActiveRecord::Base
@@ -26,6 +47,7 @@ class Project < ActiveRecord::Base
has_many :wikis, dependent: :destroy
has_many :protected_branches, dependent: :destroy
has_one :last_event, class_name: 'Event', order: 'events.created_at DESC', foreign_key: 'project_id'
+ has_many :services, dependent: :destroy
delegate :name, to: :owner, allow_nil: true, prefix: true
@@ -163,25 +185,3 @@ class Project < ActiveRecord::Base
issues.tag_counts_on(:labels)
end
end
-
-# == Schema Information
-#
-# Table name: projects
-#
-# id :integer not null, primary key
-# name :string(255)
-# path :string(255)
-# description :text
-# created_at :datetime not null
-# updated_at :datetime not null
-# private_flag :boolean default(TRUE), not null
-# code :string(255)
-# owner_id :integer
-# default_branch :string(255)
-# issues_enabled :boolean default(TRUE), not null
-# wall_enabled :boolean default(TRUE), not null
-# merge_requests_enabled :boolean default(TRUE), not null
-# wiki_enabled :boolean default(TRUE), not null
-# group_id :integer
-#
-
diff --git a/app/models/project_hook.rb b/app/models/project_hook.rb
index 92f6d1f0c53..aebf2054f8e 100644
--- a/app/models/project_hook.rb
+++ b/app/models/project_hook.rb
@@ -1,16 +1,15 @@
-class ProjectHook < WebHook
- belongs_to :project
-end
-
# == Schema Information
#
# Table name: web_hooks
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# url :string(255)
# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# type :string(255) default("ProjectHook")
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string(255) default("ProjectHook")
#
+class ProjectHook < WebHook
+ belongs_to :project
+end
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb
index 926692f1cba..c54aa3ce9a2 100644
--- a/app/models/protected_branch.rb
+++ b/app/models/protected_branch.rb
@@ -1,3 +1,14 @@
+# == Schema Information
+#
+# Table name: protected_branches
+#
+# id :integer not null, primary key
+# project_id :integer not null
+# name :string(255) not null
+# created_at :datetime not null
+# updated_at :datetime not null
+#
+
class ProtectedBranch < ActiveRecord::Base
include GitHost
@@ -18,15 +29,3 @@ class ProtectedBranch < ActiveRecord::Base
project.commit(self.name)
end
end
-
-# == Schema Information
-#
-# Table name: protected_branches
-#
-# id :integer not null, primary key
-# project_id :integer not null
-# name :string(255) not null
-# created_at :datetime not null
-# updated_at :datetime not null
-#
-
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index 3525219e709..997c19bdb6b 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -1,3 +1,18 @@
+# == Schema Information
+#
+# Table name: snippets
+#
+# id :integer not null, primary key
+# title :string(255)
+# content :text
+# author_id :integer not null
+# project_id :integer not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# file_name :string(255)
+# expires_at :datetime
+#
+
class Snippet < ActiveRecord::Base
include Linguist::BlobHelper
@@ -48,19 +63,3 @@ class Snippet < ActiveRecord::Base
expires_at && expires_at < Time.current
end
end
-
-# == Schema Information
-#
-# Table name: snippets
-#
-# id :integer not null, primary key
-# title :string(255)
-# content :text
-# author_id :integer not null
-# project_id :integer not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# file_name :string(255)
-# expires_at :datetime
-#
-
diff --git a/app/models/system_hook.rb b/app/models/system_hook.rb
index f56b80f4678..3bc9089fdc8 100644
--- a/app/models/system_hook.rb
+++ b/app/models/system_hook.rb
@@ -1,3 +1,15 @@
+# == Schema Information
+#
+# Table name: web_hooks
+#
+# id :integer not null, primary key
+# url :string(255)
+# project_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string(255) default("ProjectHook")
+#
+
class SystemHook < WebHook
def self.all_hooks_fire(data)
SystemHook.all.each do |sh|
@@ -9,16 +21,3 @@ class SystemHook < WebHook
Resque.enqueue(SystemHookWorker, id, data)
end
end
-
-# == Schema Information
-#
-# Table name: web_hooks
-#
-# id :integer not null, primary key
-# url :string(255)
-# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# type :string(255) default("ProjectHook")
-#
-
diff --git a/app/models/user.rb b/app/models/user.rb
index b048469817b..6d539c1f498 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,3 +1,37 @@
+# == Schema Information
+#
+# Table name: users
+#
+# id :integer not null, primary key
+# email :string(255) default(""), not null
+# encrypted_password :string(255) default(""), not null
+# reset_password_token :string(255)
+# reset_password_sent_at :datetime
+# remember_created_at :datetime
+# sign_in_count :integer default(0)
+# current_sign_in_at :datetime
+# last_sign_in_at :datetime
+# current_sign_in_ip :string(255)
+# last_sign_in_ip :string(255)
+# created_at :datetime not null
+# updated_at :datetime not null
+# name :string(255)
+# admin :boolean default(FALSE), not null
+# projects_limit :integer default(10)
+# skype :string(255) default(""), not null
+# linkedin :string(255) default(""), not null
+# twitter :string(255) default(""), not null
+# authentication_token :string(255)
+# dark_scheme :boolean default(FALSE), not null
+# theme_id :integer default(1), not null
+# bio :string(255)
+# blocked :boolean default(FALSE), not null
+# failed_attempts :integer default(0)
+# locked_at :datetime
+# extern_uid :string(255)
+# provider :string(255)
+#
+
class User < ActiveRecord::Base
include Account
@@ -79,38 +113,3 @@ class User < ActiveRecord::Base
end
end
end
-
-# == Schema Information
-#
-# Table name: users
-#
-# id :integer not null, primary key
-# email :string(255) default(""), not null
-# encrypted_password :string(128) default(""), not null
-# reset_password_token :string(255)
-# reset_password_sent_at :datetime
-# remember_created_at :datetime
-# sign_in_count :integer default(0)
-# current_sign_in_at :datetime
-# last_sign_in_at :datetime
-# current_sign_in_ip :string(255)
-# last_sign_in_ip :string(255)
-# created_at :datetime not null
-# updated_at :datetime not null
-# name :string(255)
-# admin :boolean default(FALSE), not null
-# projects_limit :integer default(10)
-# skype :string(255) default(""), not null
-# linkedin :string(255) default(""), not null
-# twitter :string(255) default(""), not null
-# authentication_token :string(255)
-# dark_scheme :boolean default(FALSE), not null
-# theme_id :integer default(1), not null
-# bio :string(255)
-# blocked :boolean default(FALSE), not null
-# failed_attempts :integer default(0)
-# locked_at :datetime
-# extern_uid :string(255)
-# provider :string(255)
-#
-
diff --git a/app/models/users_project.rb b/app/models/users_project.rb
index 967c78f22aa..6231088ff79 100644
--- a/app/models/users_project.rb
+++ b/app/models/users_project.rb
@@ -1,3 +1,15 @@
+# == Schema Information
+#
+# Table name: users_projects
+#
+# id :integer not null, primary key
+# user_id :integer not null
+# project_id :integer not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# project_access :integer default(0), not null
+#
+
class UsersProject < ActiveRecord::Base
include GitHost
@@ -119,16 +131,3 @@ class UsersProject < ActiveRecord::Base
self.class.access_roles.invert[self.project_access]
end
end
-
-# == Schema Information
-#
-# Table name: users_projects
-#
-# id :integer not null, primary key
-# user_id :integer not null
-# project_id :integer not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# project_access :integer default(0), not null
-#
-
diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb
index db773c55a69..ac3e10cf96f 100644
--- a/app/models/web_hook.rb
+++ b/app/models/web_hook.rb
@@ -1,3 +1,15 @@
+# == Schema Information
+#
+# Table name: web_hooks
+#
+# id :integer not null, primary key
+# url :string(255)
+# project_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string(255) default("ProjectHook")
+#
+
class WebHook < ActiveRecord::Base
include HTTParty
@@ -22,16 +34,3 @@ class WebHook < ActiveRecord::Base
end
end
end
-
-# == Schema Information
-#
-# Table name: web_hooks
-#
-# id :integer not null, primary key
-# url :string(255)
-# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# type :string(255) default("ProjectHook")
-#
-
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
index 895c2896462..252a97e8cca 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -1,3 +1,17 @@
+# == Schema Information
+#
+# Table name: wikis
+#
+# id :integer not null, primary key
+# title :string(255)
+# content :text
+# project_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# slug :string(255)
+# user_id :integer
+#
+
class Wiki < ActiveRecord::Base
attr_accessible :title, :content, :slug
@@ -38,18 +52,3 @@ class Wiki < ActiveRecord::Base
end
end
-
-# == Schema Information
-#
-# Table name: wikis
-#
-# id :integer not null, primary key
-# title :string(255)
-# content :text
-# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# slug :string(255)
-# user_id :integer
-#
-
diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml
index 8bdeda1cafe..9ee65942fe9 100644
--- a/app/views/projects/_form.html.haml
+++ b/app/views/projects/_form.html.haml
@@ -10,9 +10,8 @@
.input
= f.text_field :name, placeholder: "Example Project", class: "xxlarge"
- %hr
- .adv_settings
- %h6 Advanced settings:
+ %fieldset
+ %legend Advanced settings:
.clearfix
= f.label :path do
Path
@@ -34,9 +33,8 @@
.input= f.select(:default_branch, @project.heads.map(&:name), {}, style: "width:210px;")
- unless @project.new_record?
- %hr
- .adv_settings
- %h6 Features:
+ %fieldset
+ %legend Features:
.clearfix
= f.label :issues_enabled, "Issues"
diff --git a/db/schema.rb b/db/schema.rb
index e7eb5696b0e..b11542704af 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20121026114600) do
+ActiveRecord::Schema.define(:version => 20121120051432) do
create_table "events", :force => true do |t|
t.string "target_type"
@@ -127,6 +127,15 @@ ActiveRecord::Schema.define(:version => 20121026114600) do
t.datetime "updated_at", :null => false
end
+ create_table "services", :force => true do |t|
+ t.string "type"
+ t.string "title"
+ t.string "token"
+ t.integer "project_id", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "snippets", :force => true do |t|
t.string "title"
t.text "content"
@@ -203,6 +212,7 @@ ActiveRecord::Schema.define(:version => 20121026114600) do
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "type", :default => "ProjectHook"
+ t.integer "service_id"
end
create_table "wikis", :force => true do |t|
diff --git a/spec/factories.rb b/spec/factories.rb
index 7b2a2efab23..7c33f0ecc8b 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -132,4 +132,16 @@ FactoryGirl.define do
name
project
end
+
+ factory :service do
+ type ""
+ title "GitLab CI"
+ token "x56olispAND34ng"
+ project
+ end
+
+ factory :service_hook do
+ url
+ service
+ end
end
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb
index d68ebb8614b..49cb49db375 100644
--- a/spec/models/event_spec.rb
+++ b/spec/models/event_spec.rb
@@ -2,14 +2,14 @@
#
# Table name: events
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# target_type :string(255)
# target_id :integer
# title :string(255)
# data :text
# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
+# created_at :datetime not null
+# updated_at :datetime not null
# action :integer
# author_id :integer
#
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 5ae40658823..6ae2cb20169 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -2,12 +2,12 @@
#
# Table name: groups
#
-# id :integer not null, primary key
-# name :string(255) not null
-# code :string(255) not null
-# owner_id :integer not null
-# created_at :datetime not null
-# updated_at :datetime not null
+# id :integer not null, primary key
+# name :string(255) not null
+# code :string(255) not null
+# owner_id :integer not null
+# created_at :datetime not null
+# updated_at :datetime not null
#
require 'spec_helper'
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index 9c69f8689c8..4c52a094386 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -2,15 +2,15 @@
#
# Table name: issues
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# title :string(255)
# assignee_id :integer
# author_id :integer
# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# closed :boolean default(FALSE), not null
-# position :integer default(0)
+# created_at :datetime not null
+# updated_at :datetime not null
+# closed :boolean default(FALSE), not null
+# position :integer default(0)
# branch_name :string(255)
# description :text
# milestone_id :integer
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb
index 80dfff08397..6d2310df5c0 100644
--- a/spec/models/key_spec.rb
+++ b/spec/models/key_spec.rb
@@ -2,10 +2,10 @@
#
# Table name: keys
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# user_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
+# created_at :datetime not null
+# updated_at :datetime not null
# key :text
# title :string(255)
# identifier :string(255)
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 4bf42ef99aa..d70647f668d 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -2,20 +2,20 @@
#
# Table name: merge_requests
#
-# id :integer not null, primary key
-# target_branch :string(255) not null
-# source_branch :string(255) not null
-# project_id :integer not null
+# id :integer not null, primary key
+# target_branch :string(255) not null
+# source_branch :string(255) not null
+# project_id :integer not null
# author_id :integer
# assignee_id :integer
# title :string(255)
-# closed :boolean default(FALSE), not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# st_commits :text(4294967295
-# st_diffs :text(4294967295
-# merged :boolean default(FALSE), not null
-# state :integer default(1), not null
+# closed :boolean default(FALSE), not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# st_commits :text(2147483647)
+# st_diffs :text(2147483647)
+# merged :boolean default(FALSE), not null
+# state :integer default(1), not null
# milestone_id :integer
#
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb
index 0e5cf7dd665..431985d0d46 100644
--- a/spec/models/milestone_spec.rb
+++ b/spec/models/milestone_spec.rb
@@ -2,14 +2,14 @@
#
# Table name: milestones
#
-# id :integer not null, primary key
-# title :string(255) not null
-# project_id :integer not null
+# id :integer not null, primary key
+# title :string(255) not null
+# project_id :integer not null
# description :text
# due_date :date
-# closed :boolean default(FALSE), not null
-# created_at :datetime not null
-# updated_at :datetime not null
+# closed :boolean default(FALSE), not null
+# created_at :datetime not null
+# updated_at :datetime not null
#
require 'spec_helper'
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index d739053748f..4f9352b9a14 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -2,13 +2,13 @@
#
# Table name: notes
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# note :text
# noteable_id :string(255)
# noteable_type :string(255)
# author_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
+# created_at :datetime not null
+# updated_at :datetime not null
# project_id :integer
# attachment :string(255)
# line_code :string(255)
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 1cf4f586192..4f7afd9dd25 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -2,20 +2,20 @@
#
# Table name: projects
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# name :string(255)
# path :string(255)
# description :text
-# created_at :datetime not null
-# updated_at :datetime not null
-# private_flag :boolean default(TRUE), not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# private_flag :boolean default(TRUE), not null
# code :string(255)
# owner_id :integer
# default_branch :string(255)
-# issues_enabled :boolean default(TRUE), not null
-# wall_enabled :boolean default(TRUE), not null
-# merge_requests_enabled :boolean default(TRUE), not null
-# wiki_enabled :boolean default(TRUE), not null
+# issues_enabled :boolean default(TRUE), not null
+# wall_enabled :boolean default(TRUE), not null
+# merge_requests_enabled :boolean default(TRUE), not null
+# wiki_enabled :boolean default(TRUE), not null
# group_id :integer
#
@@ -37,6 +37,7 @@ describe Project do
it { should have_many(:hooks).dependent(:destroy) }
it { should have_many(:wikis).dependent(:destroy) }
it { should have_many(:protected_branches).dependent(:destroy) }
+ it { should have_many(:services).dependent(:destroy) }
end
describe "Mass assignment" do
diff --git a/spec/models/protected_branch_spec.rb b/spec/models/protected_branch_spec.rb
index 874c4e4d885..7340ce50ced 100644
--- a/spec/models/protected_branch_spec.rb
+++ b/spec/models/protected_branch_spec.rb
@@ -2,11 +2,11 @@
#
# Table name: protected_branches
#
-# id :integer not null, primary key
-# project_id :integer not null
-# name :string(255) not null
-# created_at :datetime not null
-# updated_at :datetime not null
+# id :integer not null, primary key
+# project_id :integer not null
+# name :string(255) not null
+# created_at :datetime not null
+# updated_at :datetime not null
#
require 'spec_helper'
diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb
index ada5fcdbcb8..b474d88c9e2 100644
--- a/spec/models/snippet_spec.rb
+++ b/spec/models/snippet_spec.rb
@@ -2,13 +2,13 @@
#
# Table name: snippets
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# title :string(255)
# content :text
-# author_id :integer not null
-# project_id :integer not null
-# created_at :datetime not null
-# updated_at :datetime not null
+# author_id :integer not null
+# project_id :integer not null
+# created_at :datetime not null
+# updated_at :datetime not null
# file_name :string(255)
# expires_at :datetime
#
diff --git a/spec/models/system_hook_spec.rb b/spec/models/system_hook_spec.rb
index 5f9239119b0..a99e91d34d0 100644
--- a/spec/models/system_hook_spec.rb
+++ b/spec/models/system_hook_spec.rb
@@ -2,12 +2,12 @@
#
# Table name: web_hooks
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# url :string(255)
# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# type :string(255) default("ProjectHook")
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string(255) default("ProjectHook")
#
require "spec_helper"
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index b9654d7002c..4ac699b1c45 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -2,31 +2,31 @@
#
# Table name: users
#
-# id :integer not null, primary key
-# email :string(255) default(""), not null
-# encrypted_password :string(128) default(""), not null
+# id :integer not null, primary key
+# email :string(255) default(""), not null
+# encrypted_password :string(255) default(""), not null
# reset_password_token :string(255)
# reset_password_sent_at :datetime
# remember_created_at :datetime
-# sign_in_count :integer default(0)
+# sign_in_count :integer default(0)
# current_sign_in_at :datetime
# last_sign_in_at :datetime
# current_sign_in_ip :string(255)
# last_sign_in_ip :string(255)
-# created_at :datetime not null
-# updated_at :datetime not null
+# created_at :datetime not null
+# updated_at :datetime not null
# name :string(255)
-# admin :boolean default(FALSE), not null
-# projects_limit :integer default(10)
-# skype :string(255) default(""), not null
-# linkedin :string(255) default(""), not null
-# twitter :string(255) default(""), not null
+# admin :boolean default(FALSE), not null
+# projects_limit :integer default(10)
+# skype :string(255) default(""), not null
+# linkedin :string(255) default(""), not null
+# twitter :string(255) default(""), not null
# authentication_token :string(255)
-# dark_scheme :boolean default(FALSE), not null
-# theme_id :integer default(1), not null
+# dark_scheme :boolean default(FALSE), not null
+# theme_id :integer default(1), not null
# bio :string(255)
-# blocked :boolean default(FALSE), not null
-# failed_attempts :integer default(0)
+# blocked :boolean default(FALSE), not null
+# failed_attempts :integer default(0)
# locked_at :datetime
# extern_uid :string(255)
# provider :string(255)
diff --git a/spec/models/users_project_spec.rb b/spec/models/users_project_spec.rb
index 2ad9a0bd909..1f896324f18 100644
--- a/spec/models/users_project_spec.rb
+++ b/spec/models/users_project_spec.rb
@@ -2,12 +2,12 @@
#
# Table name: users_projects
#
-# id :integer not null, primary key
-# user_id :integer not null
-# project_id :integer not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# project_access :integer default(0), not null
+# id :integer not null, primary key
+# user_id :integer not null
+# project_id :integer not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# project_access :integer default(0), not null
#
require 'spec_helper'
diff --git a/spec/models/web_hook_spec.rb b/spec/models/web_hook_spec.rb
index 8f8decb81c6..aa040b5064f 100644
--- a/spec/models/web_hook_spec.rb
+++ b/spec/models/web_hook_spec.rb
@@ -2,12 +2,12 @@
#
# Table name: web_hooks
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# url :string(255)
# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
-# type :string(255) default("ProjectHook")
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string(255) default("ProjectHook")
#
require 'spec_helper'
diff --git a/spec/models/wiki_spec.rb b/spec/models/wiki_spec.rb
index 96aebd2ddb7..9750b81d303 100644
--- a/spec/models/wiki_spec.rb
+++ b/spec/models/wiki_spec.rb
@@ -2,12 +2,12 @@
#
# Table name: wikis
#
-# id :integer not null, primary key
+# id :integer not null, primary key
# title :string(255)
# content :text
# project_id :integer
-# created_at :datetime not null
-# updated_at :datetime not null
+# created_at :datetime not null
+# updated_at :datetime not null
# slug :string(255)
# user_id :integer
#