Sha256: a43b95f557005ebef4d1e1271297582eaf3dde314a401bd78a72bc9de3b02730
Contents?: true
Size: 931 Bytes
Versions: 2
Compression:
Stored size: 931 Bytes
Contents
module Phcmembers class Member::Address < ApplicationRecord # Clean URL Initialize extend FriendlyId # Add Paper Trail has_paper_trail :class_name => 'Phcmembers::AddressVersions' # Model Relationships belongs_to :profile, class_name: 'Phcmembers::Member::Profile' # Validation for Form Fields validates :mcaddressl1, presence: true, length: { minimum: 2 } validates :mccity, length: { minimum: 3 } validates :mcprovince, presence: true, length: { minimum: 2 } validates :mccountry, presence: true, length: { minimum: 2 } validates :mcpostalcode, presence: true, length: { minimum: 3 } validates :mctype, presence: true, length: { minimum: 2 } # Clean URL Define friendly_id :phcmembers_address_slug, use: [:slugged, :finders] # Define for Multiple Records def phcmembers_address_slug [ [:mcaddressl1, :mccity, :mcprovince] ] end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
phcmembers-14.0.1 | app/models/phcmembers/member/address.rb |
phcmembers-14.0.0 | app/models/phcmembers/member/address.rb |