phcdevworks_tutorials 2.1.2 → 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: 33e27b7f41f07b09e2baff0704a5aba9588b2408eff2c2d1824539e2b804d561
4
- data.tar.gz: adfd438d8a8b1217fea7e9df4da3f77ccb3581f22dc6112a15e5e50809120b3a
3
+ metadata.gz: d73bfa6d1cf3e314aa938a5a67ce544c7899b2d56b19afcb0a147354216eb704
4
+ data.tar.gz: c8fa6aafa79e2504e5709718a727c44214ad5dba8acab50cf745eb7d7855c66e
5
5
  SHA512:
6
- metadata.gz: 5a24a436b3be0a2026e93abaf93ff77048fe3fbd916ff50d966660d572c91bac5250218338f9bbb862592ccad5e03b5ebe7a6b57a32d20172fef0729f6465022
7
- data.tar.gz: 541c6f66f94a4850c67b2617894b87ad7f1ff2a632c6bfbf15fcf09b5a04f249b86e0f202ce251f2751be8a50e50f2e728fcc513f83156c8301f68d68384aae7
6
+ metadata.gz: 201a7c24fe3acd7d3f83648ce8e46da7c09ac03e90d700df9d34c50ca8178120b55a3892959c6dc529fb423bf493dc9ad58459f2cb021e2f2cabbec15460a610
7
+ data.tar.gz: 5b28edd1312dd7a228514e983968730ad52b79daa7bb0b4a35ecf159d1ee654ca97f8fec2ae7dc168f6ca961a55bfd1a6b4e26a90d1425e98a35b35b4f52f5ff
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).
@@ -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(:tutorial_post_title, :tutorial_post_description, :tutorial_post_status, :tutorial_post_image, :slug, :user_id, :org_id, category_ids: [])
78
78
  end
79
79
 
80
80
  end
@@ -5,7 +5,7 @@ module PhcdevworksTutorials
5
5
  extend FriendlyId
6
6
 
7
7
  #Relationships
8
- has_and_belongs_to_many :posts, class_name: 'Tutorial::Post', :join_table => 'categories_posts', :dependent => :destroy
8
+ has_and_belongs_to_many :posts, class_name: "Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
9
9
 
10
10
  # Form Fields Validation
11
11
  validates :tutorial_category_name,
@@ -8,7 +8,7 @@ module PhcdevworksTutorials
8
8
  has_one_attached :tutorial_post_image
9
9
 
10
10
  # Relationships
11
- has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "categories_posts", :dependent => :destroy
11
+ has_and_belongs_to_many :categories, class_name: "Tutorial::Category", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
12
12
  has_many :steps, class_name: "Tutorial::Step"
13
13
  belongs_to :user, class_name: "PhcdevworksAccounts::User"
14
14
 
@@ -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 -->
@@ -18,7 +18,7 @@
18
18
 
19
19
  <div class="form-group field_with_errors">
20
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"}) %>
21
+ <%= form.select( :tutorial_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">
@@ -50,7 +50,7 @@
50
50
  <tr>
51
51
  <td><%= tutorial_post.tutorial_post_title %></td>
52
52
  <td><%= tutorial_post.tutorial_post_description %></td>
53
- <td><%= tutorial_post.tutorial_post_status %></td>
53
+ <td><%= tutorial_post.tutorial_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" %>
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksTutorials
2
- VERSION = '2.1.2'
2
+ VERSION = "3.0.0"
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: 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: 2019-10-20 00:00:00.000000000 Z
11
+ date: 2019-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -301,10 +301,10 @@ files:
301
301
  - app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb
302
302
  - app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb
303
303
  - config/routes.rb
304
- - db/migrate/20191003235303_create_join_table_categories_posts.rb
305
304
  - db/migrate/20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb
306
305
  - db/migrate/20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb
307
306
  - db/migrate/20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb
307
+ - db/migrate/20191024232406_create_phcdevworks_tutorials_categories_posts.rb
308
308
  - lib/phcdevworks_tutorials.rb
309
309
  - lib/phcdevworks_tutorials/engine.rb
310
310
  - lib/phcdevworks_tutorials/version.rb
@@ -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