phcdevworks_tutorials 2.1.2 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -27
  3. data/app/controllers/phcdevworks_tutorials/blog/tutorials_controller.rb +1 -1
  4. data/app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb +1 -1
  5. data/app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb +1 -1
  6. data/app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb +2 -2
  7. data/app/models/phcdevworks_tutorials/tutorial/category.rb +6 -3
  8. data/app/models/phcdevworks_tutorials/tutorial/post.rb +10 -7
  9. data/app/models/phcdevworks_tutorials/tutorial/step.rb +4 -1
  10. data/app/models/phcdevworks_tutorials/tutorial_category_versions.rb +5 -0
  11. data/app/models/phcdevworks_tutorials/tutorial_post_versions.rb +5 -0
  12. data/app/models/phcdevworks_tutorials/tutorial_step_versions.rb +5 -0
  13. data/app/views/layouts/phcdevworks_tutorials/application.html.erb +2 -2
  14. data/app/views/layouts/phcdevworks_tutorials/components/backend/sidebars/_side_menu.html.erb +22 -0
  15. data/app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb +2 -2
  16. data/app/views/phcdevworks_tutorials/tutorial/categories/index.html.erb +1 -1
  17. data/app/views/phcdevworks_tutorials/tutorial/categories/show.html.erb +1 -1
  18. data/app/views/phcdevworks_tutorials/tutorial/posts/_form.html.erb +11 -11
  19. data/app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb +3 -3
  20. data/app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb +8 -8
  21. data/app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb +2 -2
  22. data/config/routes.rb +18 -18
  23. data/db/migrate/20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb +4 -4
  24. data/db/migrate/20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb +4 -4
  25. data/db/migrate/20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb +1 -1
  26. data/db/migrate/20191024232406_create_phcdevworks_tutorials_categories_posts.rb +8 -0
  27. data/db/migrate/20191102093129_create_phcdevworks_tutorials_tutorial_post_versions.rb +19 -0
  28. data/db/migrate/20191102093146_create_phcdevworks_tutorials_tutorial_step_versions.rb +19 -0
  29. data/db/migrate/20191102093157_create_phcdevworks_tutorials_tutorial_category_versions.rb +18 -0
  30. data/lib/phcdevworks_tutorials/version.rb +1 -1
  31. metadata +9 -4
  32. data/app/models/phcdevworks_tutorials/category.rb +0 -7
  33. data/db/migrate/20191003235303_create_join_table_categories_posts.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33e27b7f41f07b09e2baff0704a5aba9588b2408eff2c2d1824539e2b804d561
4
- data.tar.gz: adfd438d8a8b1217fea7e9df4da3f77ccb3581f22dc6112a15e5e50809120b3a
3
+ metadata.gz: 911021b85eef6a1a6e1e1d5f545e498e2d4577d499ebda07163fe2867b8993f3
4
+ data.tar.gz: c5bac2a5b843898df28d301d98e76f8f76c5b5233538833ee466ccafc40617b4
5
5
  SHA512:
6
- metadata.gz: 5a24a436b3be0a2026e93abaf93ff77048fe3fbd916ff50d966660d572c91bac5250218338f9bbb862592ccad5e03b5ebe7a6b57a32d20172fef0729f6465022
7
- data.tar.gz: 541c6f66f94a4850c67b2617894b87ad7f1ff2a632c6bfbf15fcf09b5a04f249b86e0f202ce251f2751be8a50e50f2e728fcc513f83156c8301f68d68384aae7
6
+ metadata.gz: c9097d1fc460e2e6aaa6e0348fc2db42321b235c6486733fa2d32e09026ee746d68ca6315a7224922c48d01edee518cd83e113925f0894f3fe705a147283c6cb
7
+ data.tar.gz: be0ae7cb36f5feeca4a6763171213b533541062206599ca9feb5b74a6ed03169ba4196a8bdecaf218b98c2073d7c5e9e5b6b2d21f3f28aa78f4170234365cf2b
data/README.md CHANGED
@@ -1,28 +1 @@
1
1
  # PhcdevworksTutorials
2
- Short description and motivation.
3
-
4
- ## Usage
5
- How to use my plugin.
6
-
7
- ## Installation
8
- Add this line to your application's Gemfile:
9
-
10
- ```ruby
11
- gem 'phcdevworks_tutorials'
12
- ```
13
-
14
- And then execute:
15
- ```bash
16
- $ bundle
17
- ```
18
-
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install phcdevworks_tutorials
22
- ```
23
-
24
- ## Contributing
25
- Contribution directions go here.
26
-
27
- ## License
28
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -8,7 +8,7 @@ module PhcdevworksTutorials
8
8
 
9
9
  # INDEX
10
10
  def index
11
- @phcdevworks_tutorials_index = Tutorial::Post.where(tutorial_post_status: "published")
11
+ @phcdevworks_tutorials_index = Tutorial::Post.where(post_status: "published")
12
12
  end
13
13
 
14
14
  # SHOW
@@ -74,7 +74,7 @@ module PhcdevworksTutorials
74
74
 
75
75
  # Whitelist
76
76
  def tutorial_category_params
77
- params.require(:tutorial_category).permit(:tutorial_category_name, :slug, :user_id, :org_id)
77
+ params.require(:tutorial_category).permit(:category_name, :slug, :user_id, :org_id)
78
78
  end
79
79
 
80
80
  end
@@ -74,7 +74,7 @@ module PhcdevworksTutorials
74
74
 
75
75
  # Whitelist
76
76
  def tutorial_post_params
77
- params.require(:tutorial_post).permit(:tutorial_post_title, :tutorial_post_description, :tutorial_post_status, :tutorial_post_image, :slug, :user_id, :org_id)
77
+ params.require(:tutorial_post).permit(:post_title, :post_description, :post_status, :post_image, :slug, :user_id, :org_id, category_ids: [])
78
78
  end
79
79
 
80
80
  end
@@ -11,7 +11,7 @@ module PhcdevworksTutorials
11
11
 
12
12
  # GET /tutorial/steps
13
13
  def index
14
- @tutorial_steps = tutorial_post.steps.order("tutorial_step_number")
14
+ @tutorial_steps = tutorial_post.steps.order("step_number")
15
15
  end
16
16
 
17
17
  # GET /tutorial/steps/1
@@ -82,7 +82,7 @@ module PhcdevworksTutorials
82
82
 
83
83
  # Whitelist
84
84
  def tutorial_step_params
85
- params.require(:tutorial_step).permit(:tutorial_step_number, :tutorial_step_title, :tutorial_step_description, :tutorial_step_image, :post_id, :slug, :user_id, :org_id)
85
+ params.require(:tutorial_step).permit(:step_number, :step_title, :step_description, :step_image, :post_id, :slug, :user_id, :org_id)
86
86
  end
87
87
 
88
88
  end
@@ -4,11 +4,14 @@ module PhcdevworksTutorials
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
6
6
 
7
+ # Paper Trail Initialize
8
+ has_paper_trail :class_name => 'PhcdevworksTutorials::TutorialCategoryVersions'
9
+
7
10
  #Relationships
8
- has_and_belongs_to_many :posts, class_name: 'Tutorial::Post', :join_table => 'categories_posts', :dependent => :destroy
11
+ has_and_belongs_to_many :posts, class_name: "Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
9
12
 
10
13
  # Form Fields Validation
11
- validates :tutorial_category_name,
14
+ validates :category_name,
12
15
  presence: true,
13
16
  uniqueness: true
14
17
 
@@ -16,7 +19,7 @@ module PhcdevworksTutorials
16
19
  friendly_id :phcdev_tutorials_category_nice_urls, use: [:slugged, :finders]
17
20
 
18
21
  def phcdev_tutorials_category_nice_urls
19
- [:tutorial_category_name]
22
+ [:category_name]
20
23
  end
21
24
 
22
25
  end
@@ -4,26 +4,29 @@ module PhcdevworksTutorials
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
6
6
 
7
+ # Paper Trail Initialize
8
+ has_paper_trail :class_name => 'PhcdevworksTutorials::TutorialPostVersions'
9
+
7
10
  # Image Upload
8
- has_one_attached :tutorial_post_image
11
+ has_one_attached :post_image
9
12
 
10
13
  # Relationships
11
- has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "categories_posts", :dependent => :destroy
14
+ has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
12
15
  has_many :steps, class_name: "Tutorial::Step"
13
16
  belongs_to :user, class_name: "PhcdevworksAccounts::User"
14
17
 
15
18
  # Form Fields Validation
16
- validates :tutorial_post_title,
19
+ validates :post_title,
17
20
  presence: true
18
21
 
19
- validates :tutorial_post_description,
22
+ validates :post_description,
20
23
  presence: true
21
24
 
22
25
  # Clean URL Define
23
- friendly_id :phcdev_tutorials_post_nice_urls, use: [:slugged, :finders]
26
+ friendly_id :phcdev_tutorial_post_nice_urls, use: [:slugged, :finders]
24
27
 
25
- def phcdev_tutorials_post_nice_urls
26
- [:tutorial_post_title]
28
+ def phcdev_tutorial_post_nice_urls
29
+ [:post_title]
27
30
  end
28
31
 
29
32
  end
@@ -1,8 +1,11 @@
1
1
  module PhcdevworksTutorials
2
2
  class Tutorial::Step < ApplicationRecord
3
3
 
4
+ # Paper Trail Initialize
5
+ has_paper_trail :class_name => 'PhcdevworksTutorials::TutorialStepVersions'
6
+
4
7
  # Image Upload
5
- has_one_attached :tutorial_step_image
8
+ has_one_attached :step_image
6
9
 
7
10
  # Relationships
8
11
  belongs_to :post, class_name: "Tutorial::Post"
@@ -0,0 +1,5 @@
1
+ module PhcdevworksTutorials
2
+ class TutorialCategoryVersions < PaperTrail::Version
3
+ self.table_name = :phcdevworks_tutorials_tutorial_category_versions
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module PhcdevworksTutorials
2
+ class TutorialPostVersions < PaperTrail::Version
3
+ self.table_name = :phcdevworks_tutorials_tutorial_post_versions
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module PhcdevworksTutorials
2
+ class TutorialStepVersions < PaperTrail::Version
3
+ self.table_name = :phcdevworks_tutorials_tutorial_step_versions
4
+ end
5
+ end
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
 
5
5
  <!-- SEO System -->
6
- <% phc_seo_title "PHCDevworks Scripts" %>
7
- <% phc_seo_description "Ruby on Rails 6 Script CDN and Code Snippets Listing Management Engine." %>
6
+ <% phc_seo_title "PHCDevworks Tutorials" %>
7
+ <% phc_seo_description "Ruby on Rails 6 Engine to Manage Online Tutorials." %>
8
8
  <!-- SEO System -->
9
9
 
10
10
  <!-- SEO and Site Description -->
@@ -81,6 +81,28 @@
81
81
  <li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts#new") %>"><%= link_to("New Project", phcdevworks_portfolio.new_project_post_path) %></li>
82
82
  </ul>
83
83
  </li>
84
+ <li class="has-sub">
85
+ <a href="javascript:;">
86
+ <b class="caret"></b>
87
+ <i class="fad fa-sitemap"></i>
88
+ <span>Project Categories</span>
89
+ </a>
90
+ <ul class="sub-menu">
91
+ <li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts") %>"><%= link_to("Project Category", phcdevworks_portfolio.project_categories_path) %></li>
92
+ <li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts#new") %>"><%= link_to("New Category", phcdevworks_portfolio.new_project_category_path) %></li>
93
+ </ul>
94
+ </li>
95
+ <li class="has-sub">
96
+ <a href="javascript:;">
97
+ <b class="caret"></b>
98
+ <i class="fad fa-folders"></i>
99
+ <span>Project Types</span>
100
+ </a>
101
+ <ul class="sub-menu">
102
+ <li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts") %>"><%= link_to("Project Type", phcdevworks_portfolio.project_types_path) %></li>
103
+ <li class="<%= phc_menu_active_controller("phcdevworks_portfolio/project/posts#new") %>"><%= link_to("New Types", phcdevworks_portfolio.new_project_type_path) %></li>
104
+ </ul>
105
+ </li>
84
106
  <!-- Sidebar - Sidebar Navigation - PHCDevworks Press -->
85
107
  <% end %>
86
108
 
@@ -7,8 +7,8 @@
7
7
 
8
8
  <!-- Form Input Fields -->
9
9
  <div class="form-group field_with_errors">
10
- <%= form.label :tutorial_category_name, "Tutorial Category" %>
11
- <%= form.text_field :tutorial_category_name, placeholder: "Category Name", class: "form-control" %>
10
+ <%= form.label :category_name, "Tutorial Category" %>
11
+ <%= form.text_field :category_name, placeholder: "Category Name", class: "form-control" %>
12
12
  </div>
13
13
  <!-- Form Input Fields -->
14
14
 
@@ -46,7 +46,7 @@
46
46
  <tbody>
47
47
  <% @tutorial_categories.each do |tutorial_category| %>
48
48
  <tr>
49
- <td><%= tutorial_category.tutorial_category_name %></td>
49
+ <td><%= tutorial_category.category_name %></td>
50
50
  <td>
51
51
  <div class="btn-group d-flex" role="group">
52
52
  <%= link_to "Category Details", tutorial_category, class: "btn btn-purple btn-xs" %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <p>
4
4
  <strong>Tutorial category name:</strong>
5
- <%= @tutorial_category.tutorial_category_name %>
5
+ <%= @tutorial_category.category_name %>
6
6
  </p>
7
7
 
8
8
  <%= link_to 'Edit', edit_tutorial_category_path(@tutorial_category) %> |
@@ -7,32 +7,32 @@
7
7
 
8
8
  <!-- Form Input Fields -->
9
9
  <div class="form-group field_with_errors">
10
- <%= form.label :tutorial_post_title, "Tutorial Title" %>
11
- <%= form.text_field :tutorial_post_title, placeholder: "Tutorial Title", class: "form-control" %>
10
+ <%= form.label :post_title, "Tutorial Title" %>
11
+ <%= form.text_field :post_title, placeholder: "Tutorial Title", class: "form-control" %>
12
12
  </div>
13
13
 
14
14
  <div class="form-group field_with_errors">
15
- <%= form.label :tutorial_post_description, "Tutorial Description" %>
16
- <%= form.text_area :tutorial_post_description, class: "form-control", rows: "10" %>
15
+ <%= form.label :post_description, "Tutorial Description" %>
16
+ <%= form.text_area :post_description, class: "form-control", rows: "10" %>
17
17
  </div>
18
18
 
19
19
  <div class="form-group field_with_errors">
20
- <%= form.label :tutorial_post_status, "Tutorial Status" %>
21
- <%= form.select( :tutorial_post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control form-control"}) %>
20
+ <%= form.label :post_status, "Tutorial Status" %>
21
+ <%= form.select( :post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control"}) %>
22
22
  </div>
23
23
 
24
24
  <div class="form-group field_with_errors">
25
- <%= form.label :tutorial_post_image, "Featured Image" %>
26
- <%= form.file_field :tutorial_post_image, class: "form-control" %>
25
+ <%= form.label :post_image, "Featured Image" %>
26
+ <%= form.file_field :post_image, class: "form-control" %>
27
27
  </div>
28
- <% if form.object.tutorial_post_image.attached? %>
29
- <%= image_tag main_app.url_for(form.object.tutorial_post_image), class: "img-responsive img-thumbnail" %>
28
+ <% if form.object.post_image.attached? %>
29
+ <%= image_tag main_app.url_for(form.object.post_image), class: "img-responsive img-thumbnail" %>
30
30
  <% end %>
31
31
 
32
32
  <div class="form-group field_with_errors">
33
33
  <label>Select a Category</label>
34
34
  <div class="panel-body">
35
- <%= form.collection_check_boxes :category_ids, PhcdevworksTutorials::Tutorial::Category.order(:tutorial_category_name), :id, :tutorial_category_name do |post_category| %>
35
+ <%= form.collection_check_boxes :category_ids, PhcdevworksTutorials::Tutorial::Category.order(:category_name), :id, :category_name do |post_category| %>
36
36
  <%= post_category.check_box %>
37
37
  <%= post_category.label %><br>
38
38
  <% end %>
@@ -48,9 +48,9 @@
48
48
  <tbody>
49
49
  <% @tutorial_posts.each do |tutorial_post| %>
50
50
  <tr>
51
- <td><%= tutorial_post.tutorial_post_title %></td>
52
- <td><%= tutorial_post.tutorial_post_description %></td>
53
- <td><%= tutorial_post.tutorial_post_status %></td>
51
+ <td><%= tutorial_post.post_title %></td>
52
+ <td><%= tutorial_post.post_description %></td>
53
+ <td><%= tutorial_post.post_status.capitalize %></td>
54
54
  <td>
55
55
  <div class="btn-group d-flex" role="group">
56
56
  <%= link_to "Tutorial Details", tutorial_post, class: "btn btn-purple btn-xs" %>
@@ -7,23 +7,23 @@
7
7
 
8
8
  <!-- Form Input Fields -->
9
9
  <div class="form-group field_with_errors">
10
- <%= form.label :tutorial_step_number, "Tutorial Step" %>
11
- <%= form.select( :tutorial_step_number, [["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"]], {}, {class: "form-control"}) %>
10
+ <%= form.label :step_number, "Tutorial Step" %>
11
+ <%= form.select( :step_number, [["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"]], {}, {class: "form-control"}) %>
12
12
  </div>
13
13
 
14
14
  <div class="form-group field_with_errors">
15
- <%= form.label :tutorial_step_title, placeholder: "Step Title" %>
16
- <%= form.text_field :tutorial_step_title, class: "form-control", rows: "10" %>
15
+ <%= form.label :step_title, placeholder: "Step Title" %>
16
+ <%= form.text_field :step_title, class: "form-control", rows: "10" %>
17
17
  </div>
18
18
 
19
19
  <div class="form-group field_with_errors">
20
- <%= form.label :tutorial_step_description, "Step Text" %>
21
- <%= form.text_area :tutorial_step_description, class: "form-control", rows: "10" %>
20
+ <%= form.label :step_description, "Step Text" %>
21
+ <%= form.text_area :step_description, class: "form-control", rows: "10" %>
22
22
  </div>
23
23
 
24
24
  <div class="form-group field_with_errors">
25
- <%= form.label :tutorial_step_image, "Step Image" %>
26
- <%= form.file_field :tutorial_step_image, class: "form-control" %>
25
+ <%= form.label :step_image, "Step Image" %>
26
+ <%= form.file_field :step_image, class: "form-control" %>
27
27
  </div>
28
28
 
29
29
  <!-- Form Input Fields -->
@@ -47,8 +47,8 @@
47
47
  <tbody>
48
48
  <% @tutorial_steps.each do |tutorial_step| %>
49
49
  <tr>
50
- <td><%= tutorial_step.tutorial_step_number %></td>
51
- <td><%= tutorial_step.tutorial_step_title %></td>
50
+ <td><%= tutorial_step.step_number %></td>
51
+ <td><%= tutorial_step.step_title %></td>
52
52
  <td>
53
53
  <div class="btn-group d-flex" role="group">
54
54
  <%= link_to "Step Details", tutorial_post_step_path(tutorial_step.post, tutorial_step), class: "btn btn-purple btn-xs" %>
data/config/routes.rb CHANGED
@@ -1,27 +1,27 @@
1
1
  PhcdevworksTutorials::Engine.routes.draw do
2
2
 
3
- # Tutorial Routs
4
- namespace :tutorial do
5
- resources :posts, class_name: "Tutorial::Post" do
6
- resources :steps, class_name: "Tutorial::Step"
7
- end
8
- resources :categories, class_name: "Tutorial::Category"
3
+ # Tutorial Routs
4
+ namespace :tutorial do
5
+ resources :posts, class_name: "Tutorial::Post" do
6
+ resources :steps, class_name: "Tutorial::Step"
9
7
  end
8
+ resources :categories, class_name: "Tutorial::Category"
9
+ end
10
10
 
11
- # Frontend Routes
12
- namespace :blog do
13
- resources :tutorials, only: [:index, :show]
14
- end
11
+ # Frontend Routes
12
+ namespace :blog do
13
+ resources :tutorials, only: [:index, :show]
14
+ end
15
15
 
16
- # API Routes
17
- namespace :api, :path => "", :constraints => {:subdomain => "tutorial_api"} do
18
- namespace :v1 do
19
- resources :posts, defaults: {format: "json"}
20
- resources :categories, defaults: {format: "json"}
21
- end
16
+ # API Routes
17
+ namespace :api, :path => "", :constraints => {:subdomain => "tutorial_api"} do
18
+ namespace :v1 do
19
+ resources :posts, defaults: {format: "json"}
20
+ resources :categories, defaults: {format: "json"}
22
21
  end
22
+ end
23
23
 
24
- # Mount Routes
25
- mount PhcdevworksAccounts::Engine, :at => "/"
24
+ # Mount Routes
25
+ mount PhcdevworksAccounts::Engine, :at => "/"
26
26
 
27
27
  end
@@ -2,10 +2,10 @@ class CreatePhcdevworksTutorialsTutorialPosts < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  create_table :phcdevworks_tutorials_tutorial_posts do |t|
4
4
 
5
- t.string :tutorial_post_title
6
- t.string :tutorial_post_description
7
- t.string :tutorial_post_status
8
- t.string :tutorial_post_image
5
+ t.string :post_title
6
+ t.string :post_description
7
+ t.string :post_status
8
+ t.string :post_image
9
9
 
10
10
  t.string :slug
11
11
  t.string :user_id
@@ -2,10 +2,10 @@ class CreatePhcdevworksTutorialsTutorialSteps < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  create_table :phcdevworks_tutorials_tutorial_steps do |t|
4
4
 
5
- t.string :tutorial_step_number
6
- t.string :tutorial_step_title
7
- t.string :tutorial_step_description
8
- t.string :tutorial_step_image
5
+ t.string :step_number
6
+ t.string :step_title
7
+ t.string :step_description
8
+ t.string :step_image
9
9
 
10
10
  t.string :slug
11
11
  t.string :user_id
@@ -2,7 +2,7 @@ class CreatePhcdevworksTutorialsTutorialCategories < ActiveRecord::Migration[6.0
2
2
  def change
3
3
  create_table :phcdevworks_tutorials_tutorial_categories do |t|
4
4
 
5
- t.string :tutorial_category_name
5
+ t.string :category_name
6
6
 
7
7
  t.string :slug
8
8
  t.string :user_id
@@ -0,0 +1,8 @@
1
+ class CreatePhcdevworksTutorialsCategoriesPosts < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :phcdevworks_tutorials_categories_posts do |t|
4
+ t.integer :category_id
5
+ t.integer :post_id
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,19 @@
1
+ class CreatePhcdevworksTutorialsTutorialPostVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_tutorials_tutorial_post_versions do |t|
6
+
7
+ t.string :item_type, {:null=>false}
8
+ t.integer :item_id, null: false
9
+ t.string :event, null: false
10
+ t.string :whodunnit
11
+ t.text :object, limit: TEXT_BYTES
12
+ t.datetime :created_at
13
+
14
+ end
15
+
16
+ add_index :phcdevworks_tutorials_tutorial_post_versions, %i(item_type item_id), :name => 'tutorial_post_versions'
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ class CreatePhcdevworksTutorialsTutorialStepVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_tutorials_tutorial_step_versions do |t|
6
+
7
+ t.string :item_type, {:null=>false}
8
+ t.integer :item_id, null: false
9
+ t.string :event, null: false
10
+ t.string :whodunnit
11
+ t.text :object, limit: TEXT_BYTES
12
+ t.datetime :created_at
13
+
14
+ end
15
+
16
+ add_index :phcdevworks_tutorials_tutorial_step_versions, %i(item_type item_id), :name => 'tutorial_step_versions'
17
+
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ class CreatePhcdevworksTutorialsTutorialCategoryVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_tutorials_tutorial_category_versions do |t|
6
+
7
+ t.string :item_type, {:null=>false}
8
+ t.integer :item_id, null: false
9
+ t.string :event, null: false
10
+ t.string :whodunnit
11
+ t.text :object, limit: TEXT_BYTES
12
+ t.datetime :created_at
13
+
14
+ end
15
+
16
+ add_index :phcdevworks_tutorials_tutorial_category_versions, %i(item_type item_id), :name => 'tutorial_category_versions'
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksTutorials
2
- VERSION = '2.1.2'
2
+ VERSION = "5.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcdevworks_tutorials
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHCDevworks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-20 00:00:00.000000000 Z
11
+ date: 2019-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -273,11 +273,13 @@ files:
273
273
  - app/jobs/phcdevworks_tutorials/application_job.rb
274
274
  - app/mailers/phcdevworks_tutorials/application_mailer.rb
275
275
  - app/models/phcdevworks_tutorials/application_record.rb
276
- - app/models/phcdevworks_tutorials/category.rb
277
276
  - app/models/phcdevworks_tutorials/tutorial.rb
278
277
  - app/models/phcdevworks_tutorials/tutorial/category.rb
279
278
  - app/models/phcdevworks_tutorials/tutorial/post.rb
280
279
  - app/models/phcdevworks_tutorials/tutorial/step.rb
280
+ - app/models/phcdevworks_tutorials/tutorial_category_versions.rb
281
+ - app/models/phcdevworks_tutorials/tutorial_post_versions.rb
282
+ - app/models/phcdevworks_tutorials/tutorial_step_versions.rb
281
283
  - app/views/layouts/phcdevworks_tutorials/application.html.erb
282
284
  - app/views/layouts/phcdevworks_tutorials/components/backend/footer/_footer.html.erb
283
285
  - app/views/layouts/phcdevworks_tutorials/components/backend/navigation/_top_menu.html.erb
@@ -301,10 +303,13 @@ files:
301
303
  - app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb
302
304
  - app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb
303
305
  - config/routes.rb
304
- - db/migrate/20191003235303_create_join_table_categories_posts.rb
305
306
  - db/migrate/20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb
306
307
  - db/migrate/20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb
307
308
  - db/migrate/20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb
309
+ - db/migrate/20191024232406_create_phcdevworks_tutorials_categories_posts.rb
310
+ - db/migrate/20191102093129_create_phcdevworks_tutorials_tutorial_post_versions.rb
311
+ - db/migrate/20191102093146_create_phcdevworks_tutorials_tutorial_step_versions.rb
312
+ - db/migrate/20191102093157_create_phcdevworks_tutorials_tutorial_category_versions.rb
308
313
  - lib/phcdevworks_tutorials.rb
309
314
  - lib/phcdevworks_tutorials/engine.rb
310
315
  - lib/phcdevworks_tutorials/version.rb
@@ -1,7 +0,0 @@
1
- module PhcdevworksTutorials
2
- module Category
3
- def self.table_name_prefix
4
- 'phcdevworks_tutorials_category_'
5
- end
6
- end
7
- end
@@ -1,10 +0,0 @@
1
- class CreateJoinTableCategoriesPosts < ActiveRecord::Migration[6.0]
2
- def change
3
- create_join_table :categories, :posts do |t|
4
-
5
- # t.index [:category_id, :post_id]
6
- # t.index [:post_id, :category_id]
7
-
8
- end
9
- end
10
- end