Sha256: e38cd1d127bafacd71bac217335e4dc75b2a2fa5a1af5bdbd3cc53ef9e516fb7
Contents?: true
Size: 707 Bytes
Versions: 19
Compression:
Stored size: 707 Bytes
Contents
module Locomotive module Concerns module Page module Redirect extend ActiveSupport::Concern included do ## fields ## field :redirect, type: Boolean, default: false field :redirect_url, type: String, localize: true, default: '' field :redirect_type, type: Integer, default: 301 ## validations ## validates_presence_of :redirect_type, if: :redirect? validates_presence_of :redirect_url, if: :redirect? validates_format_of :redirect_url, with: Locomotive::Regexps::URL_AND_MAILTO, if: ->(page) { page.redirect? && !page.redirect_url.blank? } end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems