Project

General

Profile

Download (646 Bytes) Statistics
| Branch: | Tag: | Revision:

foreman_pipeline / app / models / foreman_pipeline / jenkins_project_param.rb @ be52ca64

1
module ForemanPipeline
2
  class JenkinsProjectParam < Katello::Model
3
    self.include_root_in_json = false
4

    
5
    include Katello::Glue
6

    
7
    include ForemanPipeline::Authorization::JenkinsProjectParam
8

    
9
    self.inheritance_column = :_inheritance_type_disabled
10
    belongs_to :organization
11
    belongs_to :jenkins_project, :class_name => "ForemanPipeline::JenkinsProject"
12
    attr_accessible :name, :type, :description, :value
13

    
14
    TYPES = ["string", "boolean", "text"]
15
    validates :type, :inclusion => { :in => TYPES }
16

    
17
    def format_bool
18
      self.value = self.value.sub(/^t$/, "true").sub(/^f$/, "false") if type == "boolean"
19
    end
20
  end
21
end