Sha256: 5a2fc389a6b11d4de728d2ff0830dd1bcef64075809e59f070d70828035999cf

Contents?: true

Size: 320 Bytes

Versions: 5

Compression:

Stored size: 320 Bytes

Contents

ActiveRecord::Migration.create_table :users do |t|
  t.date :optional_date
  t.date :end_date
  t.date :custom_format_date
end

class User < ActiveRecord::Base
  validates :optional_date, date: true
  validates :custom_format_date, date: {expected_format: 'dd/mm/yyyy'}
  validates :end_date, date: {required: true}
end

Version data entries

5 entries across 5 versions & 1 rubygems

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