phcdevworks_core_modules 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 908084ab1bac324f935acc7efeef54a089a3d9075ea4cc89ff11efb18631f4f8
4
- data.tar.gz: 03c8009534ec11c3902b4b050b8de1658a70790a1d8123f83b46e17728da8b2c
3
+ metadata.gz: 26a1d4b42d4f3a48e06cbb7b2dcfdc8a175af44eef7822c3a60ff431e9bb897f
4
+ data.tar.gz: f80048ced8e87031b052ba6207baabbd583d8dc85e4b00c0877f02faf2aa8b0f
5
5
  SHA512:
6
- metadata.gz: 379ef906193a9e52ed336055bf172cceee8d891cafb050c84e59df13033d07c2a4787a2c895389d1cfcfb9e6c5962475cc0e052a3f3cb9c2cc53c9d0834fe6fd
7
- data.tar.gz: 24ca974763484f3df0db89d8687aa1fcf65f65947c9bb0b32064287ff9a36690ff3df8caeb083078591e96ac4fe4dd350116ee30bb3f7df085701bd9f9a68531
6
+ metadata.gz: ee875e01eca345a2a0db7bcbf19bd2a122151fc57c092e004bc3750ff5bcc1a67689c29c0084c72a42bf48359a36182b798a6cffc94a19827a091ba8e00a1bee
7
+ data.tar.gz: 7665795363e0f55ba1f6d3250cfd330e393b71364cb2b5ddb6579d9aca9784e5b335e98e41d3248a8367ff8758ead188f51d0cdf236fc83b31baeaeba1ea48fd
@@ -74,7 +74,7 @@ module PhcdevworksCoreModules
74
74
 
75
75
  # Whitelist
76
76
  def post_category_params
77
- params.require(:post_category).permit(:category_name, :slug, :user_id, :org_id)
77
+ params.require(:post_category).permit(:category_name, :slug, :optimization_id, :user_id, :org_id)
78
78
  end
79
79
 
80
80
  end
@@ -11,12 +11,27 @@ module PhcdevworksCoreModules
11
11
  # Paper Trail Initialize
12
12
  has_paper_trail :class_name => "PhcdevworksCoreModules::CoreOptimizationVersions"
13
13
 
14
- # Relationships
14
+ # Relationships for Local
15
15
  belongs_to :user, class_name: "PhcdevworksAccounts::User"
16
- has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Article::Post", :join_table => "phcdevworks_press_categories_posts", :dependent => :destroy
17
- has_and_belongs_to_many :posts, class_name: "PhcdevworksPortfolio::Project::Post", :join_table => "phcdevworks_portfolio_categories_posts", :dependent => :destroy
18
- has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
19
- has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Command::Post", :join_table => "phcdevworks_tutorials_categories_commands", :dependent => :destroy
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
+ if defined?phcdevworks_scripts
23
+ has_many :listings, class_name: "PhcdevworksScripts::Script::Listing"
24
+ end
25
+ if defined?phcdevworks_press
26
+ has_many :posts, class_name: "PhcdevworksPress::Article::Post"
27
+ end
28
+ if defined?phcdevworks_portfolio
29
+ has_many :posts, class_name: "PhcdevworksPortfolio::Project::Post"
30
+ end
31
+ if defined?phcdevworks_tutorials
32
+ has_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post"
33
+ has_many :posts, class_name: "PhcdevworksTutorials::Command::Post"
34
+ end
20
35
 
21
36
  # Form Fields Validation
22
37
  validates :seo_title,
@@ -11,13 +11,21 @@ module PhcdevworksCoreModules
11
11
  # Paper Trail Initialize
12
12
  has_paper_trail :class_name => "PhcdevworksCoreModules::CoreCategoryVersions"
13
13
 
14
- # Relationships
14
+ # Relationships for Local
15
15
  belongs_to :user, class_name: "PhcdevworksAccounts::User"
16
- has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Article::Post", :join_table => "phcdevworks_press_categories_posts", :dependent => :destroy
17
- has_and_belongs_to_many :posts, class_name: "PhcdevworksPortfolio::Project::Post", :join_table => "phcdevworks_portfolio_categories_posts", :dependent => :destroy
18
- has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
19
- has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Command::Post", :join_table => "phcdevworks_tutorials_categories_commands", :dependent => :destroy
20
- has_and_belongs_to_many :optimizations, class_name: 'PhcdevworksCoreModules::Core::Optimization', :join_table => "phcdevworks_core_modules_categories_optimizations", :dependent => :destroy
16
+ belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true
17
+
18
+ # Relationships for PHCDevworks Plugins
19
+ if defined?phcdevworks_press
20
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksPress::Article::Post", :join_table => "phcdevworks_press_categories_posts", :dependent => :destroy
21
+ end
22
+ if defined?phcdevworks_portfolio
23
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksPortfolio::Project::Post", :join_table => "phcdevworks_portfolio_categories_posts", :dependent => :destroy
24
+ end
25
+ if defined?phcdevworks_tutorials
26
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
27
+ has_and_belongs_to_many :posts, class_name: "PhcdevworksTutorials::Command::Post", :join_table => "phcdevworks_tutorials_categories_commands", :dependent => :destroy
28
+ end
21
29
 
22
30
  # Form Fields Validation
23
31
  validates :category_name,
@@ -10,6 +10,11 @@
10
10
  <%= form.label :category_name, "Category Name" %>
11
11
  <%= form.text_field :category_name, class: "form-control" %>
12
12
  </div>
13
+
14
+ <div class="form-group">
15
+ <label>Attach SEO Data</label>
16
+ <%= collection_select(:post_category, :optimization_id, PhcdevworksCoreModules::Marketing::Optimization.order("seo_title"), :id, :seo_title, {}, {class: "form-control"}) %>
17
+ </div>
13
18
  <!-- Form Input Fields -->
14
19
 
15
20
  <!-- Form Submition Button -->
@@ -18,6 +18,7 @@ class CreatePhcdevworksCoreModulesMarketingOptimizations < ActiveRecord::Migrati
18
18
  t.string :slug
19
19
  t.string :user_id
20
20
  t.string :org_id
21
+
21
22
  t.timestamps
22
23
 
23
24
  end
@@ -8,6 +8,8 @@ class CreatePhcdevworksCoreModulesPostCategories < ActiveRecord::Migration[6.0]
8
8
  t.string :user_id
9
9
  t.string :org_id
10
10
 
11
+ t.string :optimization_id
12
+
11
13
  t.timestamps
12
14
 
13
15
  end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksCoreModules
2
- VERSION = '2.0.1'
2
+ VERSION = '3.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcdevworks_core_modules
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHCDevworks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-06 00:00:00.000000000 Z
11
+ date: 2020-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -306,7 +306,6 @@ files:
306
306
  - db/migrate/20170517064427_create_phcdevworks_core_modules_category_versions.rb
307
307
  - db/migrate/20200705223718_create_phcdevworks_core_modules_marketing_optimizations.rb
308
308
  - db/migrate/20200705225433_create_phcdevworks_core_modules_optimization_versions.rb
309
- - db/migrate/20200706091346_create_phcdevworks_core_modules_categories_optimizations.rb
310
309
  - db/migrate/20200706094820_create_phcdevworks_core_modules_post_categories.rb
311
310
  - lib/phcdevworks_core_modules.rb
312
311
  - lib/phcdevworks_core_modules/engine.rb
@@ -1,10 +0,0 @@
1
- class CreatePhcdevworksCoreModulesCategoriesOptimizations < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :phcdevworks_core_modules_categories_optimizations do |t|
4
-
5
- t.integer :category_id
6
- t.integer :optimization_id
7
-
8
- end
9
- end
10
- end