Sha256: efd9a1f52accf500dc75cbfcf783f32efe72987505713f5d3253a28302481cb3

Contents?: true

Size: 902 Bytes

Versions: 12

Compression:

Stored size: 902 Bytes

Contents

module PhcdevworksRealEstate
  class Property::Listing < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Image Uploading
    has_one_attached :listing_upload
    has_many_attached :gallery_upload

    # Relationships
    has_and_belongs_to_many :features, class_name: 'Phcreallistingspro::Property::Feature', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy

    # Validation for Form Fields
    validates :property_listing_title,
      presence: true

    validates :property_listing_description,
      presence: true

    validates :property_listing_street_address,
      presence: true

    validates :property_listing_price,
      presence: true

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

    def property_listing_nice_urls
      [:property_listing_title]
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
phcdevworks_real_estate-5.1.1 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-5.1.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-5.0.5 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-5.0.4 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-5.0.3 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-5.0.2 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-5.0.1 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-5.0.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-4.3.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-4.2.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-4.1.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-4.0.0 app/models/phcdevworks_real_estate/property/listing.rb