Sha256: 06f16883fe34e2b73bf3a37c29a6a601837788c4aaf4bde4f869c0cb7b307971

Contents?: true

Size: 462 Bytes

Versions: 5

Compression:

Stored size: 462 Bytes

Contents

class DockerParameter < ApplicationRecord
  extend FriendlyId
  friendly_id :key
  include Parameterizable::ByIdName

  validates_lengths_from_database

  include Authorizable
  validates :key, :presence => true, :no_whitespace => true

  scoped_search :on => :key, :complete_value => true

  default_scope -> { order("docker_parameters.key") }

  before_validation :strip_whitespaces

  def strip_whitespaces
    self.value.strip! unless value.blank?
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_docker-5.0.0 app/models/docker_parameter.rb
foreman_docker-4.1.1 app/models/docker_parameter.rb
foreman_docker-4.1.0 app/models/docker_parameter.rb
foreman_docker-4.0.0 app/models/docker_parameter.rb
foreman_docker-3.2.0 app/models/docker_parameter.rb