diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-21 18:40:04 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:31:57 -0600 |
commit | 5cd9c7c6ea1ba5c6ad40799b9476145803dccba5 (patch) | |
tree | 2b21f6f51f9fb697a268f410992e7cd3e75bf570 /app/models/members | |
parent | 8df3eb6648a561e6f4695bbd78077a369aa4b48f (diff) | |
download | gitlab-ce-5cd9c7c6ea1ba5c6ad40799b9476145803dccba5.tar.gz |
Enable Rails/Validation
Diffstat (limited to 'app/models/members')
-rw-r--r-- | app/models/members/group_member.rb | 2 | ||||
-rw-r--r-- | app/models/members/project_member.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/members/group_member.rb b/app/models/members/group_member.rb index 4043fde5301..446f9f8f8a7 100644 --- a/app/models/members/group_member.rb +++ b/app/models/members/group_member.rb @@ -5,7 +5,7 @@ class GroupMember < Member # Make sure group member points only to group as it source default_value_for :source_type, SOURCE_TYPE - validates_format_of :source_type, with: /\ANamespace\z/ + validates :source_type, format: { with: /\ANamespace\z/ } default_scope { where(source_type: SOURCE_TYPE) } def self.access_level_roles diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb index 06f8fd39c99..912820b51ac 100644 --- a/app/models/members/project_member.rb +++ b/app/models/members/project_member.rb @@ -7,7 +7,7 @@ class ProjectMember < Member # Make sure project member points only to project as it source default_value_for :source_type, SOURCE_TYPE - validates_format_of :source_type, with: /\AProject\z/ + validates :source_type, format: { with: /\AProject\z/ } validates :access_level, inclusion: { in: Gitlab::Access.values } default_scope { where(source_type: SOURCE_TYPE) } |