Sha256: 8797920f24a3f62acf1c682abe89970eff8c0b2fe1697c0badbface40bdbdecd
Contents?: true
Size: 575 Bytes
Versions: 7
Compression:
Stored size: 575 Bytes
Contents
# frozen_string_literal: true module C class Enquiry < ApplicationRecord validates :name, presence: true scope :ordered, -> { order created_at: :desc } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX } INDEX_TABLE = { "Name": { call: 'name', sort: 'name' }, "Email": { call: 'email', sort: 'email' }, "Message": { call: 'body' }, "Date": { call: 'created_at', sort: 'created_at' } }.freeze end end
Version data entries
7 entries across 7 versions & 1 rubygems