Sha256: 999176fa78ed644ab765e83c4537a0fdc93e06078c049e7ad4bc2065909ed896

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

require 'active_record'
require 'rflow/configuration/uuid_keyed'

class RFlow
  class Configuration

    class Shard < ConfigDB
      include UUIDKeyed
      include ActiveModel::Validations

      class ShardInvalid < StandardError; end

      has_many :components, :primary_key => 'uuid', :foreign_key => 'shard_uuid'

      validates_presence_of :name
      validates_uniqueness_of :name
      validates_numericality_of :count, :only_integer => true, :greater_than => 0
    end

    # STI-based classes
    class ProcessShard < Shard; end
    class ThreadShard < Shard; end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rflow-1.0.0a1 lib/rflow/configuration/shard.rb