Sha256: 93f426284796e1de837fa24b94a14136012cfed4cd384e08f9b27683c27271d3

Contents?: true

Size: 420 Bytes

Versions: 17

Compression:

Stored size: 420 Bytes

Contents

#!/usr/bin/env ruby

class CheckTemplate
  include DataMapper::Resource

  has n, :checks

  property :id,      Serial
  property :command, Text, :nullable => false
  property :name,    String, :nullable => false
  property :params,  Yaml

  validates_is_unique :command, :name

  def name_for_select
    cmd = (self.command.size > 30 ? "#{self.command[0..50]}..." : self.command)
    "#{self.name} (#{cmd})"
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
flapjack-0.6.39 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.38 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.37 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.36 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.35 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.34 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.33 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.32 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.31 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.30 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.29 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.28 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.27 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.26 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.25 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.24 lib/flapjack/persistence/data_mapper/models/check_template.rb
flapjack-0.6.23 lib/flapjack/persistence/data_mapper/models/check_template.rb