Sha256: 1a55138df60a120a00ddb44769e9814f3431d642bdeeb1624cde0d0110ced437

Contents?: true

Size: 543 Bytes

Versions: 45

Compression:

Stored size: 543 Bytes

Contents

module Inferno
  module Repositories
    class Headers < Repository
      class Model < Sequel::Model(db)
        many_to_one :request, class: 'Inferno::Repositories::Requests::Model', key: :request_id

        def before_create
          self.id = SecureRandom.uuid
          time = Time.now
          self.created_at ||= time
          self.updated_at ||= time
          super
        end

        def validate
          super
          errors.add(:request_id, 'must be present') if request_id.blank?
        end
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
inferno_core-0.4.2 lib/inferno/repositories/headers.rb
inferno_core-0.4.2.pre lib/inferno/repositories/headers.rb
inferno_core-0.4.1 lib/inferno/repositories/headers.rb
inferno_core-0.4.1.pre2 lib/inferno/repositories/headers.rb
inferno_core-0.4.1.pre lib/inferno/repositories/headers.rb
inferno_core-0.4.0 lib/inferno/repositories/headers.rb
inferno_core-0.3.12 lib/inferno/repositories/headers.rb
inferno_core-0.3.11 lib/inferno/repositories/headers.rb
inferno_core-0.3.10 lib/inferno/repositories/headers.rb
inferno_core-0.3.9 lib/inferno/repositories/headers.rb
inferno_core-0.3.8 lib/inferno/repositories/headers.rb
inferno_core-0.3.7 lib/inferno/repositories/headers.rb
inferno_core-0.3.6 lib/inferno/repositories/headers.rb
inferno_core-0.3.5 lib/inferno/repositories/headers.rb
inferno_core-0.3.4 lib/inferno/repositories/headers.rb
inferno_core-0.3.3 lib/inferno/repositories/headers.rb
inferno_core-0.3.2 lib/inferno/repositories/headers.rb
inferno_core-0.3.1 lib/inferno/repositories/headers.rb
inferno_core-0.3.0 lib/inferno/repositories/headers.rb
inferno_core-0.3.0.rc1 lib/inferno/repositories/headers.rb