Sha256: f91167eddf3c0d73c64d04776cbc990eb1b3703592065ae49cb9fe6693f5cd64
Contents?: true
Size: 725 Bytes
Versions: 52
Compression:
Stored size: 725 Bytes
Contents
module Comee module Core class Address < ApplicationRecord self.abstract_class = true BASIC_ADDRESS = "Basic Address".freeze SHIPPING_ADDRESS = "Shipping Address".freeze DELIVERY_ADDRESS = "Delivery Address".freeze INVOICING_ADDRESS = "Invoicing Address".freeze ADDRESS_TYPES = [BASIC_ADDRESS, SHIPPING_ADDRESS, DELIVERY_ADDRESS, INVOICING_ADDRESS].freeze belongs_to :country, -> { where(lookup_type: :country) }, class_name: "Comee::Core::Lookup" validates :address_line1, :address_type, presence: true validates :address_type, inclusion: {in: ADDRESS_TYPES} validates :email, format: {with: URI::MailTo::EMAIL_REGEXP}, allow_nil: true end end end
Version data entries
52 entries across 52 versions & 1 rubygems