phcdevworks_real_estate 5.1.1 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/README.md +1 -0
  4. data/Rakefile +8 -8
  5. data/app/assets/config/phcdevworks_real_estate_manifest.js +3 -3
  6. data/app/assets/stylesheets/phcdevworks_real_estate/application.scss +0 -0
  7. data/app/assets/stylesheets/phcdevworks_real_estate/property/features.scss +0 -0
  8. data/app/assets/stylesheets/phcdevworks_real_estate/property/listings.scss +0 -0
  9. data/app/controllers/phcdevworks_real_estate/application_controller.rb +13 -13
  10. data/app/controllers/phcdevworks_real_estate/property/features_controller.rb +82 -82
  11. data/app/controllers/phcdevworks_real_estate/property/listings_controller.rb +82 -82
  12. data/app/helpers/phcdevworks_real_estate/application_helper.rb +4 -4
  13. data/app/helpers/phcdevworks_real_estate/property/features_helper.rb +4 -4
  14. data/app/helpers/phcdevworks_real_estate/property/listings_helper.rb +4 -4
  15. data/app/jobs/phcdevworks_real_estate/application_job.rb +4 -4
  16. data/app/mailers/phcdevworks_real_estate/application_mailer.rb +6 -6
  17. data/app/models/phcdevworks_real_estate/application_record.rb +5 -5
  18. data/app/models/phcdevworks_real_estate/property/feature.rb +22 -22
  19. data/app/models/phcdevworks_real_estate/property/listing.rb +35 -35
  20. data/app/models/phcdevworks_real_estate/property.rb +7 -7
  21. data/app/views/layouts/phcdevworks_real_estate/application.html.erb +66 -66
  22. data/app/views/layouts/phcdevworks_real_estate/components/backend/footer/_footer.html.erb +0 -0
  23. data/app/views/layouts/phcdevworks_real_estate/components/backend/navigation/_top_menu.html.erb +0 -0
  24. data/app/views/layouts/phcdevworks_real_estate/components/backend/sidebars/_side_menu.html.erb +0 -0
  25. data/app/views/phcdevworks_real_estate/property/features/_form.html.erb +22 -22
  26. data/app/views/phcdevworks_real_estate/property/features/edit.html.erb +49 -49
  27. data/app/views/phcdevworks_real_estate/property/features/index.html.erb +82 -82
  28. data/app/views/phcdevworks_real_estate/property/features/new.html.erb +49 -49
  29. data/app/views/phcdevworks_real_estate/property/features/show.html.erb +64 -64
  30. data/app/views/phcdevworks_real_estate/property/listings/_form.html.erb +113 -113
  31. data/app/views/phcdevworks_real_estate/property/listings/edit.html.erb +49 -49
  32. data/app/views/phcdevworks_real_estate/property/listings/index.html.erb +90 -90
  33. data/app/views/phcdevworks_real_estate/property/listings/new.html.erb +49 -49
  34. data/app/views/phcdevworks_real_estate/property/listings/show.html.erb +50 -50
  35. data/config/routes.rb +19 -19
  36. data/config/spring.rb +1 -1
  37. data/db/migrate/20190824010811_create_phcdevworks_real_estate_property_listings.rb +36 -36
  38. data/db/migrate/20190824011000_create_phcdevworks_real_estate_property_features.rb +17 -17
  39. data/db/migrate/20191024232111_create_phcdevworks_real_estate_property_features_listings.rb +10 -10
  40. data/lib/phcdevworks_real_estate/engine.rb +47 -47
  41. data/lib/phcdevworks_real_estate/version.rb +3 -3
  42. data/lib/phcdevworks_real_estate.rb +6 -6
  43. data/lib/tasks/phcdevworks_real_estate_tasks.rake +4 -4
  44. metadata +33 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfdedd389553afe6cb3b2cb2125bb0cef964cba45fa3d5d2906c54320cd79f00
4
- data.tar.gz: 761ee24428d3f13533c8e3634089c204be8582f70bb4fe2df8682464848b8fda
3
+ metadata.gz: e4f86d64bdb512d47c2207a03cccc2c59a423514d4c402e8c982a07a31bee103
4
+ data.tar.gz: 48eea28e0f785eca4e6d9098977a431e36ddeed8338313a19a7277966bda4b83
5
5
  SHA512:
6
- metadata.gz: 3c18634e14f7c93020b69a4533d6e695223532ddd704b382754cc009acab975a0d33de9b73084aebd73a7ec7f83e6c297cf7ff713ee61fd9826dd2c193192cf1
7
- data.tar.gz: 1dd9731623792e7dc54ce85b6c3cc06b0a0825d5aad93ba7798d828c6e89d3f7e6aef06809f049ab72f4fdc6539f267a1652d12fdf5f6bf11f0c3297b8d5dbfe
6
+ metadata.gz: fe40c97e9fc787ccc1972ebf8b945b31c99c01e74aa082b7652f332d4b59c4639a1d2eb0c005bd8b028661fb14a3ecad86e31ea58aa4bff3e13b7aa50c7899b9
7
+ data.tar.gz: a114c26d3b0d9a7bfe6cebec45827b97379c293eb507c733f5f74c1ae739f14ae3d94afd92bd1ff570b8739a17c3231eeabef2d433d75156d2355a3f0eabdad1
data/MIT-LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright 2020 BradPotts
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright 2020 BradPotts
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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)
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
- require "bundler/setup"
2
-
3
- APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
4
- load "rails/tasks/engine.rake"
5
-
6
- load "rails/tasks/statistics.rake"
7
-
8
- require "bundler/gem_tasks"
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"
@@ -1,3 +1,3 @@
1
- //= link_directory ../stylesheets/phcdevworks_real_estate .scss
2
- //= link phcthemes_admin_panel_pack_coloradmin.css
3
- //= link phcthemes_admin_panel_pack_coloradmin.js
1
+ //= link_directory ../stylesheets/phcdevworks_real_estate .scss
2
+ //= link phcthemes_admin_panel_pack_coloradmin.css
3
+ //= link 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