phcdevworks_tutorials 4.0.1 → 5.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: c201886acd054426575703760acd433a6988760793610992321f3278492cfa8e
4
- data.tar.gz: 06d56fdb5b8116fbeb7448b0d45e9ac25bf28cdc4a393478910a408f5880c352
3
+ metadata.gz: 5e54401627aa5a710b5c18af6ce211d3dfeec4d1224bf2157a15f03ff7e5863d
4
+ data.tar.gz: c743b2587096d49ad3c81446f23ddfb59aa80c7c5ddaf1a0db6fffa846488842
5
5
  SHA512:
6
- metadata.gz: ba3d237e0c35e111db15376c8ac84a7dcbd8fd17dc33edb890c6b82b3f8a37071fe90270b092d6a49451b9943599f3b8552d37adf0e6e0df7db571c00d4689ba
7
- data.tar.gz: e39e584df04df569454758e069475d6d5fa80585f9c8ae738e4c0e5f840c7e13fc429a2375d4040aa374bcb09f9c397e05d3a28b1636ecd29522aadd1f4f0ddf
6
+ metadata.gz: 7ced7dd2b92dd5001d824fe8b6ebe91ec30b4e6f641de31e273451c2570d8d10f052644e9e1bfc1cd8a676f75d709f728341867fdb3d9eaaf78c0c2e9a23785f
7
+ data.tar.gz: 2803a0f4befc9be35e2e06060cadc41ee287c323203b52be6502541f19b369479548ba4f79db97fae54f5ce6efe466c69179780a9faf53aef395365ce5b33802
@@ -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
@@ -4,6 +4,9 @@ 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
11
  has_and_belongs_to_many :posts, class_name: "Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy
9
12
 
@@ -4,6 +4,9 @@ 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
11
  has_one_attached :post_image
9
12
 
@@ -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
@@ -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 = "4.0.1"
2
+ VERSION = "5.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: 4.0.1
4
+ version: 5.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-29 00:00:00.000000000 Z
11
+ date: 2019-11-03 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
@@ -305,6 +307,9 @@ files:
305
307
  - db/migrate/20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb
306
308
  - db/migrate/20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb
307
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