Sha256: d4dce806bf04ac219c3199853f7c7e275d4d36b38351f0ed09b3bfd9fbdabb8e

Contents?: true

Size: 458 Bytes

Versions: 4

Compression:

Stored size: 458 Bytes

Contents

class Response < Struct.new(:how_many_people, :how_many_gifts, :how_many_pies)
  #extend  ActiveModel::Naming
  #include ActiveModel::Conversion
  include ActiveModel::Validations

  validates :how_many_people, greater_than: { value: 1, operator: :>= }, allow_blank: true
  validates :how_many_gifts,  equal_to:     {attr: :how_many_people},    allow_blank: true
  validates :how_many_pies,   at_least:     { value: 1 },                allow_blank: true
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activemodel-validators-3.0.1 spec/support/models/response.rb
activemodel-validators-3.0.0 spec/support/models/response.rb
activemodel-validators-2.0.0 spec/support/models/response.rb
activemodel-validators-1.2.0 spec/support/models/response.rb