Sha256: b212298923beace5fdb6bf1ea6ae3e289cfe607ece5f565902e5778ffec5d770

Contents?: true

Size: 838 Bytes

Versions: 15

Compression:

Stored size: 838 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_features_listings'

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

    validates :listing_description,
      presence: true

    validates :listing_street_address,
      presence: true

    validates :listing_price,
      presence: true

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

    def phcdev_property_listing_nice_urls
      [:listing_title]
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
phcdevworks_real_estate-2.9.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.8.1 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.8.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.7.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.6.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.5.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.4.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.3.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.2.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.1.1 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.1.0 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.0.3 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.0.2 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.0.1 app/models/phcdevworks_real_estate/property/listing.rb
phcdevworks_real_estate-2.0.0 app/models/phcdevworks_real_estate/property/listing.rb