Sha256: 4870e1c12cec8a0e6388b32c8fe6a5dc4b05e8003919f654ce5c23513016f420

Contents?: true

Size: 944 Bytes

Versions: 8

Compression:

Stored size: 944 Bytes

Contents

module Phcmemberspro
  class Member::Address < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Add Paper Trail
    has_paper_trail

    # Model Relationships
    belongs_to :profile, class_name: 'Phcmemberspro::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

    # Define for Multiple Records
    def phcmembers_address_slug
      [
        [:id, :mcaddressl1, :mccity, :mcprovince]
      ]
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
phcmemberspro-20.5.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-20.4.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-20.3.1 app/models/phcmemberspro/member/address.rb
phcmemberspro-20.3.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-20.2.2 app/models/phcmemberspro/member/address.rb
phcmemberspro-20.2.1 app/models/phcmemberspro/member/address.rb
phcmemberspro-20.2.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-20.1.0 app/models/phcmemberspro/member/address.rb