diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-07 15:05:17 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-07 15:05:17 +0200 |
commit | ad55f0d6f9ec29026b36ee32ff5fc6081e3793de (patch) | |
tree | cd2b9919de1d5597922ac0ac1c2c3dc9a54a0ab0 /app/models | |
parent | 8b6ae0104df7e053ff3ad06e089c96273854c4e3 (diff) | |
parent | 4b7c2f0b503eb7400cee4cd5011733d689393691 (diff) | |
download | gitlab-ce-comment-updated-by.tar.gz |
Merge branch 'master' into comment-updated-bycomment-updated-by
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/abuse_report.rb | 9 | ||||
-rw-r--r-- | app/models/namespace.rb | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb new file mode 100644 index 00000000000..c8c39db11bc --- /dev/null +++ b/app/models/abuse_report.rb @@ -0,0 +1,9 @@ +class AbuseReport < ActiveRecord::Base + belongs_to :reporter, class_name: "User" + belongs_to :user + + validates :reporter, presence: true + validates :user, presence: true + validates :message, presence: true + validates :user_id, uniqueness: { scope: :reporter_id } +end diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 815672a1bf7..161a16ca61c 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -114,6 +114,9 @@ class Namespace < ActiveRecord::Base end def move_dir + # Ensure old directory exists before moving it + gitlab_shell.add_namespace(path_was) + if gitlab_shell.mv_namespace(path_was, path) # If repositories moved successfully we need to # send update instructions to users. |