File: user_with_nil.rb

package info (click to toggle)
ruby-validate-url 1.0.2%2Bgit-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 172 kB
  • sloc: ruby: 302; makefile: 4
file content (9 lines) | stat: -rw-r--r-- 172 bytes parent folder | download
1
2
3
4
5
6
7
8
9
require 'active_model/validations'

class UserWithNil
  include ActiveModel::Validations

  attr_accessor :homepage

  validates :homepage, :url => {:allow_nil => true}
end