Module: UriFormatValidator::Validators::HelperMethods

Defined in:
lib/uri_format_validator/validators/helper_methods.rb

Instance Method Summary collapse

Instance Method Details

#validates_uri_format_of(*attr_names) ⇒ Object

Encapsulates the pattern of wanting to validate an URL.

class Post < ActiveRecord::Base
  validates_uri_format_of :permalink
end


14
15
16
# File 'lib/uri_format_validator/validators/helper_methods.rb', line 14

def validates_uri_format_of(*attr_names)
  validates_with UriFormatValidator, _merge_attributes(attr_names)
end