⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 person.rb

📁 A Hotel Management System based on Ruby on Rails.
💻 RB
字号:
class Person < ActiveRecord::Base
  validates_date :date_of_birth, :allow_nil => true
  validates_date :date_of_death, :allow_nil => true, :before => Proc.new { 1.day.from_now }, :after => :date_of_birth
  
  validates_date :date_of_arrival, :allow_nil => true, :before => :date_of_departure, :after => '1 Jan 1800', :before_message => "avant %s", :after_message => "apres %s"
  
  validates_time :time_of_birth, :allow_nil => true, :before => [Proc.new { Time.now }]
  validates_time :time_of_death, :allow_nil => true, :after => [:time_of_birth, '7pm'], :before => [Proc.new { 10.years.from_now }]
  
  validates_date_time :date_and_time_of_birth, :allow_nil => true
  
  validates_date :required_date
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -