Sha256: f3b4e187750d7b9a8ecb29e53ebbdc1bfffd7adad9a8868c1b18d9d085244288
Contents?: true
Size: 1.04 KB
Versions: 4
Compression:
Stored size: 1.04 KB
Contents
module Phcmemberspro class Member::Address < ApplicationRecord # Clean URL Initialize extend FriendlyId # Add Paper Trail has_paper_trail :class_name => 'Phcmemberspro::AddressVersions' # Model Relationships belongs_to :profile, class_name: 'Phcmemberspro::Member::Profile' # Validation for Form Fields validates :address_addressl1, presence: true, length: { minimum: 2 } validates :address_city, length: { minimum: 3 } validates :address_province, presence: true, length: { minimum: 2 } validates :address_country, presence: true, length: { minimum: 2 } validates :address_postalcode, presence: true, length: { minimum: 3 } validates :address_type, presence: true, length: { minimum: 2 } # Clean URL Define friendly_id :phcmemberspro_address_slug, use: [:slugged, :finders] # Define for Multiple Records def phcmemberspro_address_slug [ [:org_id, :address_addressl1, :address_city, :address_province] ] end end end
Version data entries
4 entries across 4 versions & 1 rubygems