phcdevworks_real_estate 5.1.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +1 -0
- data/app/assets/config/phcdevworks_real_estate_manifest.js +2 -3
- data/app/controllers/phcdevworks_real_estate/application_controller.rb +13 -13
- data/app/controllers/phcdevworks_real_estate/property/features_controller.rb +82 -82
- data/app/controllers/phcdevworks_real_estate/property/listings_controller.rb +82 -82
- data/app/helpers/phcdevworks_real_estate/application_helper.rb +4 -4
- data/app/helpers/phcdevworks_real_estate/property/features_helper.rb +4 -4
- data/app/helpers/phcdevworks_real_estate/property/listings_helper.rb +4 -4
- data/app/jobs/phcdevworks_real_estate/application_job.rb +4 -4
- data/app/mailers/phcdevworks_real_estate/application_mailer.rb +6 -6
- data/app/models/phcdevworks_real_estate/application_record.rb +5 -5
- data/app/models/phcdevworks_real_estate/property/feature.rb +22 -22
- data/app/models/phcdevworks_real_estate/property/listing.rb +35 -35
- data/app/models/phcdevworks_real_estate/property.rb +7 -7
- data/app/views/layouts/phcdevworks_real_estate/application.html.erb +58 -51
- data/app/views/layouts/phcdevworks_real_estate/components/backend/footer/_footer.html.erb +10 -9
- data/app/views/layouts/phcdevworks_real_estate/components/backend/navigation/_top_menu.html.erb +26 -25
- data/app/views/layouts/phcdevworks_real_estate/components/backend/sidebars/_side_menu.html.erb +491 -287
- data/app/views/phcdevworks_real_estate/property/features/_form.html.erb +22 -22
- data/app/views/phcdevworks_real_estate/property/features/edit.html.erb +41 -49
- data/app/views/phcdevworks_real_estate/property/features/index.html.erb +74 -82
- data/app/views/phcdevworks_real_estate/property/features/new.html.erb +41 -49
- data/app/views/phcdevworks_real_estate/property/features/show.html.erb +64 -64
- data/app/views/phcdevworks_real_estate/property/listings/_form.html.erb +113 -113
- data/app/views/phcdevworks_real_estate/property/listings/edit.html.erb +41 -49
- data/app/views/phcdevworks_real_estate/property/listings/index.html.erb +82 -90
- data/app/views/phcdevworks_real_estate/property/listings/new.html.erb +41 -49
- data/app/views/phcdevworks_real_estate/property/listings/show.html.erb +50 -50
- data/config/routes.rb +15 -20
- data/config/spring.rb +1 -1
- data/db/migrate/20190824010811_create_phcdevworks_real_estate_property_listings.rb +36 -36
- data/db/migrate/20190824011000_create_phcdevworks_real_estate_property_features.rb +17 -17
- data/db/migrate/20191024232111_create_phcdevworks_real_estate_property_features_listings.rb +10 -10
- data/lib/phcdevworks_real_estate/engine.rb +45 -46
- data/lib/phcdevworks_real_estate/version.rb +3 -3
- metadata +36 -82
- data/app/assets/stylesheets/phcdevworks_real_estate/application.scss +0 -0
- data/app/assets/stylesheets/phcdevworks_real_estate/property/features.scss +0 -0
- data/app/assets/stylesheets/phcdevworks_real_estate/property/listings.scss +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67b2c8eca1e165ab4e92c88ed45c47b589f79aa77bee532875cf9d8eec0670ab
|
4
|
+
data.tar.gz: 6924b4f8cf74083f3f12e0499feb3c8ee2e6307794776d874b27cedc1e749a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ca445b840beba427c8cc0fa0f2a11cb89a1fdd91b6e919980162f020b7c156150af08a5e78c1ce29e26d6ed7b12d9429fd1a64f84293aa97821698d1f89f95c
|
7
|
+
data.tar.gz: b838499ec29b5f49993fe82f9b3c2d28ddb76a463a0efc1f680dcdbcb5fc29642af84058d0f42a85b1ad4ebec2114124d5259fd7062688dfbb308a2a40804265
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/phcdevworks_real_estate.svg)](https://badge.fury.io/rb/phcdevworks_real_estate)
|
@@ -1,3 +1,2 @@
|
|
1
|
-
//=
|
2
|
-
//= link phcthemes_admin_panel_pack_coloradmin.
|
3
|
-
//= link phcthemes_admin_panel_pack_coloradmin.js
|
1
|
+
//= link coloradmin/default/phcthemes_admin_panel_pack_coloradmin.css
|
2
|
+
//= link coloradmin/phcthemes_admin_panel_pack_coloradmin.js
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
class ApplicationController < ActionController::Base
|
3
|
-
|
4
|
-
# Security Filters
|
5
|
-
protect_from_forgery with: :exception
|
6
|
-
|
7
|
-
# Load Requried Helper Files
|
8
|
-
helper PhcdevworksActiveMenus::Engine.helpers
|
9
|
-
helper PhcdevworksNotifications::Engine.helpers
|
10
|
-
helper PhcdevworksTitleseo::Engine.helpers
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
|
4
|
+
# Security Filters
|
5
|
+
protect_from_forgery with: :exception
|
6
|
+
|
7
|
+
# Load Requried Helper Files
|
8
|
+
helper PhcdevworksActiveMenus::Engine.helpers
|
9
|
+
helper PhcdevworksNotifications::Engine.helpers
|
10
|
+
helper PhcdevworksTitleseo::Engine.helpers
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -1,82 +1,82 @@
|
|
1
|
-
require_dependency "phcdevworks_real_estate/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksRealEstate
|
4
|
-
class Property::FeaturesController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_property_feature, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /property/features
|
13
|
-
def index
|
14
|
-
@property_features = Property::Feature.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /property/features/1
|
18
|
-
def show
|
19
|
-
@property_feature = Property::Feature.friendly.find(params[:id])
|
20
|
-
end
|
21
|
-
|
22
|
-
# GET /property/features/new
|
23
|
-
def new
|
24
|
-
@property_feature = Property::Feature.new
|
25
|
-
end
|
26
|
-
|
27
|
-
# GET /property/features/1/edit
|
28
|
-
def edit
|
29
|
-
end
|
30
|
-
|
31
|
-
# POST /property/features
|
32
|
-
def create
|
33
|
-
@property_feature = Property::Feature.new(property_feature_params)
|
34
|
-
@property_feature.user_id = current_user.id
|
35
|
-
@property_feature.org_id = current_user.org_id
|
36
|
-
respond_to do |format|
|
37
|
-
if @property_feature.save
|
38
|
-
format.html { redirect_to property_features_path, :flash => { :success => 'Property Feature has been Added.' }}
|
39
|
-
format.json { render :show, status: :created, location: @property_feature }
|
40
|
-
else
|
41
|
-
format.html { render :new }
|
42
|
-
format.json { render json: @property_feature.errors, status: :unprocessable_entity }
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# PATCH/PUT /property/features/1
|
48
|
-
def update
|
49
|
-
respond_to do |format|
|
50
|
-
if @property_feature.update(property_feature_params)
|
51
|
-
format.html { redirect_to property_features_path, :flash => { :notice => 'Property Feature has been Updated.' }}
|
52
|
-
format.json { render :show, status: :ok, location: @property_feature }
|
53
|
-
else
|
54
|
-
format.html { render :edit }
|
55
|
-
format.json { render json: @property_feature.errors, status: :unprocessable_entity }
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# DELETE /property/features/1
|
61
|
-
def destroy
|
62
|
-
@property_feature.destroy
|
63
|
-
respond_to do |format|
|
64
|
-
format.html { redirect_to property_features_path, :flash => { :error => 'Property Feature has been Removed.' }}
|
65
|
-
format.json { head :no_content }
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
private
|
70
|
-
|
71
|
-
# Callbacks
|
72
|
-
def set_property_feature
|
73
|
-
@property_feature = Property::Feature.friendly.find(params[:id])
|
74
|
-
end
|
75
|
-
|
76
|
-
# Whitelist
|
77
|
-
def property_feature_params
|
78
|
-
params.require(:property_feature).permit(:property_feature_name)
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
end
|
1
|
+
require_dependency "phcdevworks_real_estate/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksRealEstate
|
4
|
+
class Property::FeaturesController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_property_feature, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /property/features
|
13
|
+
def index
|
14
|
+
@property_features = Property::Feature.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /property/features/1
|
18
|
+
def show
|
19
|
+
@property_feature = Property::Feature.friendly.find(params[:id])
|
20
|
+
end
|
21
|
+
|
22
|
+
# GET /property/features/new
|
23
|
+
def new
|
24
|
+
@property_feature = Property::Feature.new
|
25
|
+
end
|
26
|
+
|
27
|
+
# GET /property/features/1/edit
|
28
|
+
def edit
|
29
|
+
end
|
30
|
+
|
31
|
+
# POST /property/features
|
32
|
+
def create
|
33
|
+
@property_feature = Property::Feature.new(property_feature_params)
|
34
|
+
@property_feature.user_id = current_user.id
|
35
|
+
@property_feature.org_id = current_user.org_id
|
36
|
+
respond_to do |format|
|
37
|
+
if @property_feature.save
|
38
|
+
format.html { redirect_to property_features_path, :flash => { :success => 'Property Feature has been Added.' }}
|
39
|
+
format.json { render :show, status: :created, location: @property_feature }
|
40
|
+
else
|
41
|
+
format.html { render :new }
|
42
|
+
format.json { render json: @property_feature.errors, status: :unprocessable_entity }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# PATCH/PUT /property/features/1
|
48
|
+
def update
|
49
|
+
respond_to do |format|
|
50
|
+
if @property_feature.update(property_feature_params)
|
51
|
+
format.html { redirect_to property_features_path, :flash => { :notice => 'Property Feature has been Updated.' }}
|
52
|
+
format.json { render :show, status: :ok, location: @property_feature }
|
53
|
+
else
|
54
|
+
format.html { render :edit }
|
55
|
+
format.json { render json: @property_feature.errors, status: :unprocessable_entity }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# DELETE /property/features/1
|
61
|
+
def destroy
|
62
|
+
@property_feature.destroy
|
63
|
+
respond_to do |format|
|
64
|
+
format.html { redirect_to property_features_path, :flash => { :error => 'Property Feature has been Removed.' }}
|
65
|
+
format.json { head :no_content }
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
# Callbacks
|
72
|
+
def set_property_feature
|
73
|
+
@property_feature = Property::Feature.friendly.find(params[:id])
|
74
|
+
end
|
75
|
+
|
76
|
+
# Whitelist
|
77
|
+
def property_feature_params
|
78
|
+
params.require(:property_feature).permit(:property_feature_name)
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
@@ -1,82 +1,82 @@
|
|
1
|
-
require_dependency "phcdevworks_real_estate/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksRealEstate
|
4
|
-
class Property::ListingsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_property_listing, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# GET /property/listings
|
13
|
-
def index
|
14
|
-
@property_listings = Property::Listing.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /property/listings/1
|
18
|
-
def show
|
19
|
-
@property_listing = Property::Listing.friendly.find(params[:id])
|
20
|
-
end
|
21
|
-
|
22
|
-
# GET /property/listings/new
|
23
|
-
def new
|
24
|
-
@property_listing = Property::Listing.new
|
25
|
-
end
|
26
|
-
|
27
|
-
# GET /property/listings/1/edit
|
28
|
-
def edit
|
29
|
-
end
|
30
|
-
|
31
|
-
# POST /property/listings
|
32
|
-
def create
|
33
|
-
@property_listing = Property::Listing.new(property_listing_params)
|
34
|
-
@property_listing.user_id = current_user.id
|
35
|
-
@property_listing.org_id = current_user.org_id
|
36
|
-
respond_to do |format|
|
37
|
-
if @property_listing.save
|
38
|
-
format.html { redirect_to property_listings_path, :flash => { :success => 'Property Listing has been Added.' }}
|
39
|
-
format.json { render :show, status: :created, location: @property_listing }
|
40
|
-
else
|
41
|
-
format.html { render :new }
|
42
|
-
format.json { render json: @property_listing.errors, status: :unprocessable_entity }
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# PATCH/PUT /property/listings/1
|
48
|
-
def update
|
49
|
-
respond_to do |format|
|
50
|
-
if @property_listing.update(property_listing_params)
|
51
|
-
format.html { redirect_to property_listings_path, :flash => { :notice => 'Property Listing has been Updated.' }}
|
52
|
-
format.json { render :show, status: :ok, location: @property_listing }
|
53
|
-
else
|
54
|
-
format.html { render :edit }
|
55
|
-
format.json { render json: @property_listing.errors, status: :unprocessable_entity }
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# DELETE /property/listings/1
|
61
|
-
def destroy
|
62
|
-
@property_listing.destroy
|
63
|
-
respond_to do |format|
|
64
|
-
format.html { redirect_to property_listings_path, :flash => { :error => 'Property Listing has been Removed.' }}
|
65
|
-
format.json { head :no_content }
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
private
|
70
|
-
|
71
|
-
# Callbacks
|
72
|
-
def set_property_listing
|
73
|
-
@property_listing = Property::Listing.friendly.find(params[:id])
|
74
|
-
end
|
75
|
-
|
76
|
-
# Whitelist
|
77
|
-
def property_listing_params
|
78
|
-
params.require(:property_listing).permit(:property_listing_title, :property_listing_description, :property_listing_street_address, :property_listing_price, :property_listing_area, :property_listing_property_area, :property_listing_garage_area, :property_listing_room, :property_listing_bed, :property_listing_bath, :property_listing_garage, :property_listing_type, :property_listing_status, :property_listing_year_built, :property_listing_energy_class, :property_listing_leed_rating, :optimization_id, :slug, :user_id, :org_id, gallery_upload: [], feature_ids: [])
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
end
|
1
|
+
require_dependency "phcdevworks_real_estate/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksRealEstate
|
4
|
+
class Property::ListingsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_property_listing, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# GET /property/listings
|
13
|
+
def index
|
14
|
+
@property_listings = Property::Listing.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /property/listings/1
|
18
|
+
def show
|
19
|
+
@property_listing = Property::Listing.friendly.find(params[:id])
|
20
|
+
end
|
21
|
+
|
22
|
+
# GET /property/listings/new
|
23
|
+
def new
|
24
|
+
@property_listing = Property::Listing.new
|
25
|
+
end
|
26
|
+
|
27
|
+
# GET /property/listings/1/edit
|
28
|
+
def edit
|
29
|
+
end
|
30
|
+
|
31
|
+
# POST /property/listings
|
32
|
+
def create
|
33
|
+
@property_listing = Property::Listing.new(property_listing_params)
|
34
|
+
@property_listing.user_id = current_user.id
|
35
|
+
@property_listing.org_id = current_user.org_id
|
36
|
+
respond_to do |format|
|
37
|
+
if @property_listing.save
|
38
|
+
format.html { redirect_to property_listings_path, :flash => { :success => 'Property Listing has been Added.' }}
|
39
|
+
format.json { render :show, status: :created, location: @property_listing }
|
40
|
+
else
|
41
|
+
format.html { render :new }
|
42
|
+
format.json { render json: @property_listing.errors, status: :unprocessable_entity }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# PATCH/PUT /property/listings/1
|
48
|
+
def update
|
49
|
+
respond_to do |format|
|
50
|
+
if @property_listing.update(property_listing_params)
|
51
|
+
format.html { redirect_to property_listings_path, :flash => { :notice => 'Property Listing has been Updated.' }}
|
52
|
+
format.json { render :show, status: :ok, location: @property_listing }
|
53
|
+
else
|
54
|
+
format.html { render :edit }
|
55
|
+
format.json { render json: @property_listing.errors, status: :unprocessable_entity }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# DELETE /property/listings/1
|
61
|
+
def destroy
|
62
|
+
@property_listing.destroy
|
63
|
+
respond_to do |format|
|
64
|
+
format.html { redirect_to property_listings_path, :flash => { :error => 'Property Listing has been Removed.' }}
|
65
|
+
format.json { head :no_content }
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
# Callbacks
|
72
|
+
def set_property_listing
|
73
|
+
@property_listing = Property::Listing.friendly.find(params[:id])
|
74
|
+
end
|
75
|
+
|
76
|
+
# Whitelist
|
77
|
+
def property_listing_params
|
78
|
+
params.require(:property_listing).permit(:property_listing_title, :property_listing_description, :property_listing_street_address, :property_listing_price, :property_listing_area, :property_listing_property_area, :property_listing_garage_area, :property_listing_room, :property_listing_bed, :property_listing_bath, :property_listing_garage, :property_listing_type, :property_listing_status, :property_listing_year_built, :property_listing_energy_class, :property_listing_leed_rating, :optimization_id, :slug, :user_id, :org_id, gallery_upload: [], feature_ids: [])
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
module ApplicationHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
module ApplicationHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
module Property::FeaturesHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
module Property::FeaturesHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
module Property::ListingsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
module Property::ListingsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
class ApplicationJob < ActiveJob::Base
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
class ApplicationJob < ActiveJob::Base
|
3
|
+
end
|
4
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
class ApplicationMailer < ActionMailer::Base
|
3
|
-
default from: 'from@example.com'
|
4
|
-
layout 'mailer'
|
5
|
-
end
|
6
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
class ApplicationMailer < ActionMailer::Base
|
3
|
+
default from: 'from@example.com'
|
4
|
+
layout 'mailer'
|
5
|
+
end
|
6
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
class ApplicationRecord < ActiveRecord::Base
|
3
|
-
self.abstract_class = true
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
class ApplicationRecord < ActiveRecord::Base
|
3
|
+
self.abstract_class = true
|
4
|
+
end
|
5
|
+
end
|
@@ -1,22 +1,22 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
class Property::Feature < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Relationships
|
8
|
-
has_and_belongs_to_many :listings, class_name: 'Phcreallistingspro::Property::Listing', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy
|
9
|
-
|
10
|
-
# Validation for Form Fields
|
11
|
-
validates :property_feature_name,
|
12
|
-
presence: true
|
13
|
-
|
14
|
-
# Clean URL Define
|
15
|
-
friendly_id :property_feature_nice_urls, use: [:slugged, :finders]
|
16
|
-
|
17
|
-
def property_feature_nice_urls
|
18
|
-
[:property_feature_name]
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
class Property::Feature < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Relationships
|
8
|
+
has_and_belongs_to_many :listings, class_name: 'Phcreallistingspro::Property::Listing', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy
|
9
|
+
|
10
|
+
# Validation for Form Fields
|
11
|
+
validates :property_feature_name,
|
12
|
+
presence: true
|
13
|
+
|
14
|
+
# Clean URL Define
|
15
|
+
friendly_id :property_feature_nice_urls, use: [:slugged, :finders]
|
16
|
+
|
17
|
+
def property_feature_nice_urls
|
18
|
+
[:property_feature_name]
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
class Property::Listing < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Image Uploading
|
8
|
-
has_one_attached :listing_upload
|
9
|
-
has_many_attached :gallery_upload
|
10
|
-
|
11
|
-
# Relationships
|
12
|
-
has_and_belongs_to_many :features, class_name: 'Phcreallistingspro::Property::Feature', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy
|
13
|
-
|
14
|
-
# Validation for Form Fields
|
15
|
-
validates :property_listing_title,
|
16
|
-
presence: true
|
17
|
-
|
18
|
-
validates :property_listing_description,
|
19
|
-
presence: true
|
20
|
-
|
21
|
-
validates :property_listing_street_address,
|
22
|
-
presence: true
|
23
|
-
|
24
|
-
validates :property_listing_price,
|
25
|
-
presence: true
|
26
|
-
|
27
|
-
# Clean URL Define
|
28
|
-
friendly_id :property_listing_nice_urls, use: [:slugged, :finders]
|
29
|
-
|
30
|
-
def property_listing_nice_urls
|
31
|
-
[:property_listing_title]
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
class Property::Listing < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Image Uploading
|
8
|
+
has_one_attached :listing_upload
|
9
|
+
has_many_attached :gallery_upload
|
10
|
+
|
11
|
+
# Relationships
|
12
|
+
has_and_belongs_to_many :features, class_name: 'Phcreallistingspro::Property::Feature', :join_table => 'phcdevworks_real_estate_property_features_listings', :dependent => :destroy
|
13
|
+
|
14
|
+
# Validation for Form Fields
|
15
|
+
validates :property_listing_title,
|
16
|
+
presence: true
|
17
|
+
|
18
|
+
validates :property_listing_description,
|
19
|
+
presence: true
|
20
|
+
|
21
|
+
validates :property_listing_street_address,
|
22
|
+
presence: true
|
23
|
+
|
24
|
+
validates :property_listing_price,
|
25
|
+
presence: true
|
26
|
+
|
27
|
+
# Clean URL Define
|
28
|
+
friendly_id :property_listing_nice_urls, use: [:slugged, :finders]
|
29
|
+
|
30
|
+
def property_listing_nice_urls
|
31
|
+
[:property_listing_title]
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module PhcdevworksRealEstate
|
2
|
-
module Property
|
3
|
-
def self.table_name_prefix
|
4
|
-
'phcdevworks_real_estate_property_'
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
1
|
+
module PhcdevworksRealEstate
|
2
|
+
module Property
|
3
|
+
def self.table_name_prefix
|
4
|
+
'phcdevworks_real_estate_property_'
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|