phcdevworks_core_modules 7.1.4 → 7.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/README.md +0 -0
  4. data/Rakefile +8 -8
  5. data/app/assets/config/phcdevworks_core_modules_manifest.js +3 -3
  6. data/app/assets/javascripts/phcdevworks_core_modules/affiliate/links.coffee +3 -3
  7. data/app/assets/stylesheets/phcdevworks_core_modules/affiliate/links.scss +3 -3
  8. data/app/assets/stylesheets/phcdevworks_core_modules/application.scss +0 -0
  9. data/app/assets/stylesheets/phcdevworks_core_modules/marketing/optimizations.scss +3 -3
  10. data/app/assets/stylesheets/phcdevworks_core_modules/post/categories.scss +3 -3
  11. data/app/assets/stylesheets/scaffolds.scss +65 -65
  12. data/app/controllers/phcdevworks_core_modules/affiliate/links_controller.rb +81 -81
  13. data/app/controllers/phcdevworks_core_modules/application_controller.rb +13 -13
  14. data/app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb +81 -81
  15. data/app/controllers/phcdevworks_core_modules/post/categories_controller.rb +81 -81
  16. data/app/helpers/phcdevworks_core_modules/affiliate/links_helper.rb +4 -4
  17. data/app/helpers/phcdevworks_core_modules/application_helper.rb +4 -4
  18. data/app/helpers/phcdevworks_core_modules/marketing/optimizations_helper.rb +4 -4
  19. data/app/helpers/phcdevworks_core_modules/post/categories_helper.rb +4 -4
  20. data/app/jobs/phcdevworks_core_modules/application_job.rb +4 -4
  21. data/app/mailers/phcdevworks_core_modules/application_mailer.rb +6 -6
  22. data/app/models/phcdevworks_core_modules/affiliate/link.rb +35 -35
  23. data/app/models/phcdevworks_core_modules/affiliate.rb +7 -7
  24. data/app/models/phcdevworks_core_modules/affiliate_link_versions.rb +0 -0
  25. data/app/models/phcdevworks_core_modules/application_record.rb +5 -5
  26. data/app/models/phcdevworks_core_modules/marketing/optimization.rb +54 -54
  27. data/app/models/phcdevworks_core_modules/marketing.rb +7 -7
  28. data/app/models/phcdevworks_core_modules/marketing_optimization_versions.rb +0 -0
  29. data/app/models/phcdevworks_core_modules/modules.rb +7 -7
  30. data/app/models/phcdevworks_core_modules/post/category.rb +43 -43
  31. data/app/models/phcdevworks_core_modules/post.rb +7 -7
  32. data/app/models/phcdevworks_core_modules/post_category_versions.rb +0 -0
  33. data/app/views/layouts/phcdevworks_core_modules/application.html.erb +131 -131
  34. data/app/views/layouts/phcdevworks_core_modules/components/backend/footer/_footer.html.erb +0 -0
  35. data/app/views/layouts/phcdevworks_core_modules/components/backend/navigation/_top_menu.html.erb +0 -0
  36. data/app/views/layouts/phcdevworks_core_modules/components/backend/sidebars/_side_menu.html.erb +67 -5
  37. data/app/views/phcdevworks_core_modules/affiliate/links/_form.html.erb +27 -27
  38. data/app/views/phcdevworks_core_modules/affiliate/links/edit.html.erb +47 -47
  39. data/app/views/phcdevworks_core_modules/affiliate/links/index.html.erb +86 -86
  40. data/app/views/phcdevworks_core_modules/affiliate/links/new.html.erb +47 -47
  41. data/app/views/phcdevworks_core_modules/affiliate/links/show.html.erb +24 -24
  42. data/app/views/phcdevworks_core_modules/marketing/optimizations/_form.html.erb +89 -89
  43. data/app/views/phcdevworks_core_modules/marketing/optimizations/edit.html.erb +47 -47
  44. data/app/views/phcdevworks_core_modules/marketing/optimizations/index.html.erb +88 -88
  45. data/app/views/phcdevworks_core_modules/marketing/optimizations/new.html.erb +47 -47
  46. data/app/views/phcdevworks_core_modules/marketing/optimizations/show.html.erb +54 -54
  47. data/app/views/phcdevworks_core_modules/post/categories/_form.html.erb +22 -22
  48. data/app/views/phcdevworks_core_modules/post/categories/edit.html.erb +47 -47
  49. data/app/views/phcdevworks_core_modules/post/categories/index.html.erb +80 -80
  50. data/app/views/phcdevworks_core_modules/post/categories/new.html.erb +47 -47
  51. data/app/views/phcdevworks_core_modules/post/categories/show.html.erb +9 -9
  52. data/config/routes.rb +24 -25
  53. data/config/spring.rb +1 -1
  54. data/db/migrate/20170517064427_create_phcdevworks_core_modules_post_category_versions.rb +0 -0
  55. data/db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb +26 -26
  56. data/db/migrate/20200705225433_create_phcdevworks_core_modules_marketing_optimization_versions.rb +18 -18
  57. data/db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb +17 -17
  58. data/db/migrate/20201012225709_remove_phcdevworks_core_modules_post_categories.rb +7 -7
  59. data/db/migrate/20210207051304_create_phcdevworks_core_modules_affiliate_link_versions.rb +18 -18
  60. data/db/migrate/20210208130113_create_phcdevworks_core_modules_affiliate_links.rb +18 -18
  61. data/lib/phcdevworks_core_modules/engine.rb +47 -48
  62. data/lib/phcdevworks_core_modules/version.rb +3 -3
  63. data/lib/phcdevworks_core_modules.rb +6 -6
  64. data/lib/tasks/phcdevworks_core_modules_tasks.rake +4 -4
  65. metadata +31 -31
@@ -1,81 +1,81 @@
1
- require_dependency "phcdevworks_core_modules/application_controller"
2
-
3
- module PhcdevworksCoreModules
4
- class Post::CategoriesController < 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_post_category, only: [:show, :edit, :update, :destroy]
11
-
12
- # GET /post/categories
13
- def index
14
- @post_categories = Post::Category.order('post_category_name ASC')
15
- end
16
-
17
- # GET /post/categories/1
18
- def show
19
- end
20
-
21
- # GET /post/categories/new
22
- def new
23
- @post_category = Post::Category.new
24
- end
25
-
26
- # GET /post/categories/1/edit
27
- def edit
28
- end
29
-
30
- # POST /post/categories
31
- def create
32
- @post_category = Post::Category.new(post_category_params)
33
- @post_category.user_id = current_user.id
34
- @post_category.org_id = current_user.org_id
35
- respond_to do |format|
36
- if @post_category.save
37
- format.html { redirect_to post_categories_path, :flash => { :success => 'Category has been Added.' }}
38
- format.json { render :show, status: :created, location: @post_category }
39
- else
40
- format.html { render :new }
41
- format.json { render json: @post_category.errors, status: :unprocessable_entity }
42
- end
43
- end
44
- end
45
-
46
- # PATCH/PUT /post/categories/1
47
- def update
48
- respond_to do |format|
49
- if @post_category.update(post_category_params)
50
- format.html { redirect_to post_categories_path, :flash => { :notice => 'Category has been Updated.' }}
51
- format.json { render :show, status: :ok, location: @post_category }
52
- else
53
- format.html { render :edit }
54
- format.json { render json: @post_category.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # DELETE /post/categories/1
60
- def destroy
61
- @post_category.destroy
62
- respond_to do |format|
63
- format.html { redirect_to post_categories_path, :flash => { :error => 'Categories and Category Connections have all been Removed.' }}
64
- format.json { head :no_content }
65
- end
66
- end
67
-
68
- private
69
-
70
- # Common Callbacks
71
- def set_post_category
72
- @post_category = Post::Category.find(params[:id])
73
- end
74
-
75
- # Whitelist
76
- def post_category_params
77
- params.require(:post_category).permit(:post_category_name, :slug, :user_id, :org_id)
78
- end
79
-
80
- end
81
- end
1
+ require_dependency "phcdevworks_core_modules/application_controller"
2
+
3
+ module PhcdevworksCoreModules
4
+ class Post::CategoriesController < 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_post_category, only: [:show, :edit, :update, :destroy]
11
+
12
+ # GET /post/categories
13
+ def index
14
+ @post_categories = Post::Category.order('post_category_name ASC')
15
+ end
16
+
17
+ # GET /post/categories/1
18
+ def show
19
+ end
20
+
21
+ # GET /post/categories/new
22
+ def new
23
+ @post_category = Post::Category.new
24
+ end
25
+
26
+ # GET /post/categories/1/edit
27
+ def edit
28
+ end
29
+
30
+ # POST /post/categories
31
+ def create
32
+ @post_category = Post::Category.new(post_category_params)
33
+ @post_category.user_id = current_user.id
34
+ @post_category.org_id = current_user.org_id
35
+ respond_to do |format|
36
+ if @post_category.save
37
+ format.html { redirect_to post_categories_path, :flash => { :success => 'Category has been Added.' }}
38
+ format.json { render :show, status: :created, location: @post_category }
39
+ else
40
+ format.html { render :new }
41
+ format.json { render json: @post_category.errors, status: :unprocessable_entity }
42
+ end
43
+ end
44
+ end
45
+
46
+ # PATCH/PUT /post/categories/1
47
+ def update
48
+ respond_to do |format|
49
+ if @post_category.update(post_category_params)
50
+ format.html { redirect_to post_categories_path, :flash => { :notice => 'Category has been Updated.' }}
51
+ format.json { render :show, status: :ok, location: @post_category }
52
+ else
53
+ format.html { render :edit }
54
+ format.json { render json: @post_category.errors, status: :unprocessable_entity }
55
+ end
56
+ end
57
+ end
58
+
59
+ # DELETE /post/categories/1
60
+ def destroy
61
+ @post_category.destroy
62
+ respond_to do |format|
63
+ format.html { redirect_to post_categories_path, :flash => { :error => 'Categories and Category Connections have all been Removed.' }}
64
+ format.json { head :no_content }
65
+ end
66
+ end
67
+
68
+ private
69
+
70
+ # Common Callbacks
71
+ def set_post_category
72
+ @post_category = Post::Category.find(params[:id])
73
+ end
74
+
75
+ # Whitelist
76
+ def post_category_params
77
+ params.require(:post_category).permit(:post_category_name, :slug, :user_id, :org_id)
78
+ end
79
+
80
+ end
81
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- module Affiliate::LinksHelper
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ module Affiliate::LinksHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- module ApplicationHelper
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- module Marketing::OptimizationsHelper
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ module Marketing::OptimizationsHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- module Post::CategoriesHelper
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ module Post::CategoriesHelper
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module PhcdevworksCoreModules
2
- class ApplicationJob < ActiveJob::Base
3
- end
4
- end
1
+ module PhcdevworksCoreModules
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -1,6 +1,6 @@
1
- module PhcdevworksCoreModules
2
- class ApplicationMailer < ActionMailer::Base
3
- default from: 'from@example.com'
4
- layout 'mailer'
5
- end
6
- end
1
+ module PhcdevworksCoreModules
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -1,35 +1,35 @@
1
- module PhcdevworksCoreModules
2
- class Affiliate::Link < ApplicationRecord
3
-
4
- # Clean URL Initialize
5
- extend FriendlyId
6
-
7
- # Validations
8
- validates :affiliate_link_name, presence: true
9
- validates :affiliate_link_button_text, presence: false
10
- validates :affiliate_link_url, presence: true
11
- validates :affiliate_link_original_url, presence: false
12
-
13
-
14
-
15
- # Paper Trail Initialize
16
- has_paper_trail versions: {class_name: "PhcdevworksCoreModules::AffiliateLinkVersions"}
17
-
18
- # Relationships for Local
19
- belongs_to :user, class_name: "PhcdevworksAccounts::User"
20
-
21
- if defined?phcdevworks_press
22
- has_many :posts, class_name: "PhcdevworksPress::Article::Post"
23
- has_many :posts, class_name: "PhcdevworksPress::Review::Post"
24
- has_many :posts, class_name: "PhcdevworksPress::List::Post"
25
- end
26
-
27
- # Clean URL Define
28
- friendly_id :affiliate_link_nice_urls, use: [:slugged, :finders]
29
-
30
- def affiliate_link_nice_urls
31
- [:affiliate_link_name]
32
- end
33
-
34
- end
35
- end
1
+ module PhcdevworksCoreModules
2
+ class Affiliate::Link < ApplicationRecord
3
+
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
+
7
+ # Validations
8
+ validates :affiliate_link_name, presence: true
9
+ validates :affiliate_link_button_text, presence: false
10
+ validates :affiliate_link_url, presence: true
11
+ validates :affiliate_link_original_url, presence: false
12
+
13
+
14
+
15
+ # Paper Trail Initialize
16
+ has_paper_trail versions: {class_name: "PhcdevworksCoreModules::AffiliateLinkVersions"}
17
+
18
+ # Relationships for Local
19
+ belongs_to :user, class_name: "PhcdevworksAccounts::User"
20
+
21
+ if defined?phcdevworks_press
22
+ has_many :posts, class_name: "PhcdevworksPress::Article::Post"
23
+ has_many :posts, class_name: "PhcdevworksPress::Review::Post"
24
+ has_many :posts, class_name: "PhcdevworksPress::List::Post"
25
+ end
26
+
27
+ # Clean URL Define
28
+ friendly_id :affiliate_link_nice_urls, use: [:slugged, :finders]
29
+
30
+ def affiliate_link_nice_urls
31
+ [:affiliate_link_name]
32
+ end
33
+
34
+ end
35
+ end
@@ -1,7 +1,7 @@
1
- module PhcdevworksCoreModules
2
- module Affiliate
3
- def self.table_name_prefix
4
- 'phcdevworks_core_modules_affiliate_'
5
- end
6
- end
7
- end
1
+ module PhcdevworksCoreModules
2
+ module Affiliate
3
+ def self.table_name_prefix
4
+ 'phcdevworks_core_modules_affiliate_'
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
- module PhcdevworksCoreModules
2
- class ApplicationRecord < ActiveRecord::Base
3
- self.abstract_class = true
4
- end
5
- end
1
+ module PhcdevworksCoreModules
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -1,54 +1,54 @@
1
- module PhcdevworksCoreModules
2
- class Marketing::Optimization < ApplicationRecord
3
-
4
- # Clean URL Initialize
5
- extend FriendlyId
6
-
7
- # Image Upload
8
- has_one_attached :marketing_optimization_twitter_image
9
- has_one_attached :marketing_optimization_og_image
10
-
11
- # Paper Trail Initialize
12
- has_paper_trail versions: {class_name: "PhcdevworksCoreModules::MarketingOptimizationVersions"}
13
-
14
- # Relationships for Local
15
- belongs_to :user, class_name: "PhcdevworksAccounts::User"
16
- has_many :categories, class_name: "PhcdevworksCoreModules::Post::Category"
17
-
18
- # Relationships for PHCDevworks Plugins
19
- if defined?phcdevworks_members
20
- has_many :listings, class_name: "PhcdevworksMembers::Member::Listing"
21
- end
22
-
23
- if defined?phcdevworks_scripts
24
- has_many :listings, class_name: "PhcdevworksScripts::Script::Listing"
25
- end
26
-
27
- if defined?phcdevworks_press
28
- has_many :posts, class_name: "PhcdevworksPress::Article::Post"
29
- has_many :posts, class_name: "PhcdevworksPress::Review::Post"
30
- has_many :posts, class_name: "PhcdevworksPress::List::Post"
31
- end
32
-
33
- if defined?phcdevworks_portfolio
34
- has_many :posts, class_name: "PhcdevworksPortfolio::Project::Post"
35
- end
36
-
37
- if defined?phcdevworks_tutorials
38
- has_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post"
39
- has_many :posts, class_name: "PhcdevworksTutorials::Command::Post"
40
- end
41
-
42
- # Form Fields Validation
43
- validates :marketing_optimization_page_title,
44
- presence: true
45
-
46
- # Clean URL Define
47
- friendly_id :marketing_optimization_nice_urls, use: [:slugged, :finders]
48
-
49
- def marketing_optimization_nice_urls
50
- [:marketing_optimization_page_title]
51
- end
52
-
53
- end
54
- end
1
+ module PhcdevworksCoreModules
2
+ class Marketing::Optimization < ApplicationRecord
3
+
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
+
7
+ # Image Upload
8
+ has_one_attached :marketing_optimization_twitter_image
9
+ has_one_attached :marketing_optimization_og_image
10
+
11
+ # Paper Trail Initialize
12
+ has_paper_trail versions: {class_name: "PhcdevworksCoreModules::MarketingOptimizationVersions"}
13
+
14
+ # Relationships for Local
15
+ belongs_to :user, class_name: "PhcdevworksAccounts::User"
16
+ has_many :categories, class_name: "PhcdevworksCoreModules::Post::Category"
17
+
18
+ # Relationships for PHCDevworks Plugins
19
+ if defined?phcdevworks_members
20
+ has_many :listings, class_name: "PhcdevworksMembers::Member::Listing"
21
+ end
22
+
23
+ if defined?phcdevworks_scripts
24
+ has_many :listings, class_name: "PhcdevworksScripts::Script::Listing"
25
+ end
26
+
27
+ if defined?phcdevworks_press
28
+ has_many :posts, class_name: "PhcdevworksPress::Article::Post"
29
+ has_many :posts, class_name: "PhcdevworksPress::Review::Post"
30
+ has_many :posts, class_name: "PhcdevworksPress::List::Post"
31
+ end
32
+
33
+ if defined?phcdevworks_portfolio
34
+ has_many :posts, class_name: "PhcdevworksPortfolio::Project::Post"
35
+ end
36
+
37
+ if defined?phcdevworks_tutorials
38
+ has_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post"
39
+ has_many :posts, class_name: "PhcdevworksTutorials::Command::Post"
40
+ end
41
+
42
+ # Form Fields Validation
43
+ validates :marketing_optimization_page_title,
44
+ presence: true
45
+
46
+ # Clean URL Define
47
+ friendly_id :marketing_optimization_nice_urls, use: [:slugged, :finders]
48
+
49
+ def marketing_optimization_nice_urls
50
+ [:marketing_optimization_page_title]
51
+ end
52
+
53
+ end
54
+ end
@@ -1,7 +1,7 @@
1
- module PhcdevworksCoreModules
2
- module Marketing
3
- def self.table_name_prefix
4
- 'phcdevworks_core_modules_marketing_'
5
- end
6
- end
7
- end
1
+ module PhcdevworksCoreModules
2
+ module Marketing
3
+ def self.table_name_prefix
4
+ 'phcdevworks_core_modules_marketing_'
5
+ end
6
+ end
7
+ end
@@ -1,7 +1,7 @@
1
- module PhcdevworksCoreModules
2
- module Modules
3
- def self.table_name_prefix
4
- 'phcdevworks_core_modules_modules_'
5
- end
6
- end
7
- end
1
+ module PhcdevworksCoreModules
2
+ module Modules
3
+ def self.table_name_prefix
4
+ 'phcdevworks_core_modules_modules_'
5
+ end
6
+ end
7
+ end
@@ -1,43 +1,43 @@
1
- module PhcdevworksCoreModules
2
- class Post::Category < ApplicationRecord
3
-
4
- # Clean URL Initialize
5
- extend FriendlyId
6
-
7
- # Paper Trail Initialize
8
- has_paper_trail :class_name => "PhcdevworksCoreModules::PostCategoryVersions"
9
-
10
- # Relationships for Local
11
- belongs_to :user, class_name: "PhcdevworksAccounts::User"
12
- belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
13
-
14
- # Relationships for PHCDevworks Plugins
15
- if defined?phcdevworks_press
16
- has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Article::Post", :join_table => "phcdevworks_press_article_categories_posts", :dependent => :destroy
17
- has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Review::Post", :join_table => "phcdevworks_press_review_categories_posts", :dependent => :destroy
18
- has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::List::Post", :join_table => "phcdevworks_press_list_categories_posts", :dependent => :destroy
19
- end
20
-
21
- if defined?phcdevworks_portfolio
22
- has_and_belongs_to_many :posts, class_name: "PhcdevworksPortfolio::Project::Post", :join_table => "phcdevworks_portfolio_project_categories_posts", :dependent => :destroy
23
- end
24
-
25
- if defined?phcdevworks_tutorials
26
- has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post", :join_table => "phcdevworks_tutorials_tutorial_categories_posts", :dependent => :destroy
27
- has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Command::Post", :join_table => "phcdevworks_tutorials_command_categories_posts", :dependent => :destroy
28
- end
29
-
30
- # Form Fields Validation
31
- validates :post_category_name,
32
- presence: true,
33
- uniqueness: true
34
-
35
- # Clean URL Define
36
- friendly_id :post_category_nice_urls, use: [:slugged, :finders]
37
-
38
- def post_category_nice_urls
39
- [:post_category_name]
40
- end
41
-
42
- end
43
- end
1
+ module PhcdevworksCoreModules
2
+ class Post::Category < ApplicationRecord
3
+
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
+
7
+ # Paper Trail Initialize
8
+ has_paper_trail :class_name => "PhcdevworksCoreModules::PostCategoryVersions"
9
+
10
+ # Relationships for Local
11
+ belongs_to :user, class_name: "PhcdevworksAccounts::User"
12
+ belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
13
+
14
+ # Relationships for PHCDevworks Plugins
15
+ if defined?phcdevworks_press
16
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Article::Post", :join_table => "phcdevworks_press_article_categories_posts", :dependent => :destroy
17
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Review::Post", :join_table => "phcdevworks_press_review_categories_posts", :dependent => :destroy
18
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::List::Post", :join_table => "phcdevworks_press_list_categories_posts", :dependent => :destroy
19
+ end
20
+
21
+ if defined?phcdevworks_portfolio
22
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksPortfolio::Project::Post", :join_table => "phcdevworks_portfolio_project_categories_posts", :dependent => :destroy
23
+ end
24
+
25
+ if defined?phcdevworks_tutorials
26
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post", :join_table => "phcdevworks_tutorials_tutorial_categories_posts", :dependent => :destroy
27
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Command::Post", :join_table => "phcdevworks_tutorials_command_categories_posts", :dependent => :destroy
28
+ end
29
+
30
+ # Form Fields Validation
31
+ validates :post_category_name,
32
+ presence: true,
33
+ uniqueness: true
34
+
35
+ # Clean URL Define
36
+ friendly_id :post_category_nice_urls, use: [:slugged, :finders]
37
+
38
+ def post_category_nice_urls
39
+ [:post_category_name]
40
+ end
41
+
42
+ end
43
+ end
@@ -1,7 +1,7 @@
1
- module PhcdevworksCoreModules
2
- module Post
3
- def self.table_name_prefix
4
- 'phcdevworks_core_modules_post_'
5
- end
6
- end
7
- end
1
+ module PhcdevworksCoreModules
2
+ module Post
3
+ def self.table_name_prefix
4
+ 'phcdevworks_core_modules_post_'
5
+ end
6
+ end
7
+ end