Sha256: feed04e06eb3414940042f50064e4db8b925322d7946f7ea64993a157a431d50

Contents?: true

Size: 881 Bytes

Versions: 13

Compression:

Stored size: 881 Bytes

Contents

module PhcdevworksMembers
  class Member::Address < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail :class_name => 'PhcdevworksMembers::AddressVersions'

    # Relationships
    belongs_to :profile, class_name: 'PhcdevworksMembers::Member::Profile'

    # Form Fields Validation
    validates :member_address_line_1,
      presence: true

    validates :member_address_city,
      presence: true

    validates :member_address_province,
      presence: true

    validates :member_address_country,
      presence: true

    validates :member_address_postal_code,
      presence: true

    # Clean URL Define
    friendly_id :phc_nice_url_slug, use: [:slugged, :finders]

    def phc_nice_url_slug
      [
        [:member_address_city, :member_address_province, :member_address_type]
      ]
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
phcdevworks_members-2.1.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-2.0.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-1.0.1 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-1.0.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.10.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.8.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.7.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.6.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.5.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.4.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.3.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.2.0 app/models/phcdevworks_members/member/address.rb
phcdevworks_members-0.1.0 app/models/phcdevworks_members/member/address.rb