Module: URLAttributes
- Defined in:
- lib/url_attributes/extensions/active_record.rb,
lib/url_attributes/version.rb
Overview
Use:
# Model with string attributes called 'checkout_url' and 'homepage_url'
class Example < ActiveRecord::Base
url_attribute :checkout_url, :homepage_url
end
The above will cause the attribute ‘url’ to be validated with URLValidator (NB the validation will pass if no URL is present), and it will have ‘http://’ added it to it if it’s not provided.
Defined Under Namespace
Modules: ActiveRecord
Constant Summary collapse
- VERSION =
"1.3.0"