Sha256: 57447d31e3a3232ac554dd1e1c2d11ead7d29b277fecfb9e45fdb77b0d269c74
Contents?: true
Size: 564 Bytes
Versions: 9
Compression:
Stored size: 564 Bytes
Contents
module Logistics module Core class Client < ApplicationRecord VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :name, presence: true validates :email, format: { with: VALID_EMAIL_REGEX } belongs_to :country belongs_to :client_category delegate(:name, to: :country, prefix: true, allow_nil: true) delegate(:name, to: :client_category, prefix: true, allow_nil: true) before_save { email.downcase! } def self.build(options = {}) Client.new(options) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems