diff options
author | Mark Chao <mchao@gitlab.com> | 2018-11-22 17:35:28 +0800 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2019-01-15 17:10:30 +0800 |
commit | d253440ed16118d9bae78773fe96ea53aa6537a4 (patch) | |
tree | 1266af59da82983c5f18d91497dcb5f04067507f /app/models | |
parent | 2abbfda301cdb6f1360800b5db203b10debeaffa (diff) | |
download | gitlab-ce-d253440ed16118d9bae78773fe96ea53aa6537a4.tar.gz |
Add query method for id query
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/application_record.rb | 4 | ||||
-rw-r--r-- | app/models/namespace.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 71fbba5b328..29696ab276f 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -2,4 +2,8 @@ class ApplicationRecord < ActiveRecord::Base self.abstract_class = true + + def self.id_in(ids) + where(id: ids) + end end diff --git a/app/models/namespace.rb b/app/models/namespace.rb index a0bebc5e9a2..f7592532c5b 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Namespace < ActiveRecord::Base +class Namespace < ApplicationRecord include CacheMarkdownField include Sortable include Gitlab::VisibilityLevel diff --git a/app/models/user.rb b/app/models/user.rb index 26fd2d903a1..12f318e075e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,7 +2,7 @@ require 'carrierwave/orm/activerecord' -class User < ActiveRecord::Base +class User < ApplicationRecord extend Gitlab::ConfigHelper include Gitlab::ConfigHelper |