diff options
Diffstat (limited to 'app/models/project_setting.rb')
-rw-r--r-- | app/models/project_setting.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/project_setting.rb b/app/models/project_setting.rb new file mode 100644 index 00000000000..37e4a7be770 --- /dev/null +++ b/app/models/project_setting.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ProjectSetting < ApplicationRecord + belongs_to :project, inverse_of: :project_setting + + self.primary_key = :project_id + + def self.where_or_create_by(attrs) + where(primary_key => safe_find_or_create_by(attrs)) + end +end |