phcdevworks_scripts 3.0.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/phcdevworks_scripts/script/versions_controller.rb +1 -1
  3. data/app/controllers/phcdevworks_scripts/snippet/urls_controller.rb +16 -16
  4. data/app/models/phcdevworks_scripts/script/author.rb +1 -1
  5. data/app/models/phcdevworks_scripts/script/extension.rb +1 -1
  6. data/app/models/phcdevworks_scripts/script/listing.rb +1 -1
  7. data/app/models/phcdevworks_scripts/script/url.rb +1 -1
  8. data/app/models/phcdevworks_scripts/script/version.rb +3 -3
  9. data/app/models/phcdevworks_scripts/{author_versions.rb → script_author_versions.rb} +1 -1
  10. data/app/models/phcdevworks_scripts/{extension_versions.rb → script_extension_versions.rb} +1 -1
  11. data/app/models/phcdevworks_scripts/{listing_versions.rb → script_listing_versions.rb} +1 -1
  12. data/app/models/phcdevworks_scripts/{url_versions.rb → script_url_versions.rb} +1 -1
  13. data/app/models/phcdevworks_scripts/script_version_versions.rb +5 -0
  14. data/app/models/phcdevworks_scripts/snippet/post.rb +4 -1
  15. data/app/models/phcdevworks_scripts/snippet/url.rb +4 -1
  16. data/app/models/phcdevworks_scripts/snippet_post_versions.rb +5 -0
  17. data/app/models/phcdevworks_scripts/snippet_url_versions.rb +5 -0
  18. data/app/views/phcdevworks_scripts/script/versions/_form.html.erb +2 -2
  19. data/app/views/phcdevworks_scripts/script/versions/index.html.erb +1 -1
  20. data/app/views/phcdevworks_scripts/snippet/urls/_form.html.erb +4 -4
  21. data/app/views/phcdevworks_scripts/snippet/urls/index.html.erb +5 -5
  22. data/app/views/phcdevworks_scripts/snippet/urls/show.html.erb +1 -1
  23. data/config/routes.rb +11 -32
  24. data/db/migrate/20170517064030_create_phcdevworks_scripts_extension_versions.rb +2 -2
  25. data/db/migrate/20170517064049_create_phcdevworks_scripts_listing_versions.rb +2 -2
  26. data/db/migrate/20170517064114_create_phcdevworks_scripts_script_version_versions.rb +17 -0
  27. data/db/migrate/20170517064150_create_phcdevworks_scripts_url_versions.rb +2 -2
  28. data/db/migrate/20170517064208_create_phcdevworks_scripts_author_versions.rb +2 -2
  29. data/db/migrate/20170517064427_create_phcdevworks_scripts_licence_versions.rb +2 -2
  30. data/db/migrate/20190818031653_create_phcdevworks_scripts_script_versions.rb +1 -1
  31. data/db/migrate/{20170517064114_create_phcdevworks_scripts_scriptversion_versions.rb → 20191102092649_create_phcdevworks_scripts_snippet_url_versions.rb} +5 -3
  32. data/db/migrate/20191102092711_create_phcdevworks_scripts_snippet_post_versions.rb +19 -0
  33. data/lib/phcdevworks_scripts/version.rb +1 -1
  34. metadata +12 -8
  35. data/app/models/phcdevworks_scripts/scriptversion_versions.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdc65da1db885cb8d3d319a09f6d2f48032a50d3bb201a7a0dfe549dfe085b16
4
- data.tar.gz: 2d3819fe1716ef598b02660ebebd552ba411fdbe8104ac6cf66e0662163041e1
3
+ metadata.gz: d2a20abf78d7048f2bf574e0a61b8414698634e2e76f96d9de2bc96357a28d6a
4
+ data.tar.gz: f1e93c89baae3e9ec2027e83bea845dc2cbeba00ef70dc7d0b032775398464f4
5
5
  SHA512:
6
- metadata.gz: 0ae2b3933af5302f31ddc09b74dec652184a0ad33757e22dd3c4f7be754db949efd42cffa4867dfce6483bc5614c34d10bbb9fce305f6f95407b96ce83730d2e
7
- data.tar.gz: 3e6e9dd720d54be8c9444b3eca14242560fd8f486a2d32682e4f3812389d2c282079042bce2527556379597f2f29828bbbbad09a15cb62702a38a9c5842e8939
6
+ metadata.gz: 9d530e6b89cb5901a96c8eaf151a28adf880280a51a685ed3ed410ff225d72907b8d6e228432973dc4a4bc514bad8b1871ab2af83f2f3fd2564fac823f7919a6
7
+ data.tar.gz: 323e0219415effce3acb5d5e1ea89cabcd60493982e366a7b9b75f2cdee51f8193f5ce3df9fca741c616375a5115c402970df22feb8dba58e6f8323346046914
@@ -76,7 +76,7 @@ module PhcdevworksScripts
76
76
 
77
77
  # Whitelist
78
78
  def script_version_params
79
- params.require(:script_version).permit(:version_number)
79
+ params.require(:script_version).permit(:script_version_number)
80
80
  end
81
81
 
82
82
  end
@@ -5,23 +5,23 @@ module PhcdevworksScripts
5
5
 
6
6
  # Filters & Security
7
7
  #include PhcdevworksCore::PhcpluginsHelper
8
- #before_action :authenticate_user!
8
+ before_action :authenticate_user!
9
9
  before_action :set_paper_trail_whodunnit
10
10
  before_action :set_snippet_url, only: [:show, :edit, :update, :destroy]
11
11
 
12
12
  # INDEX
13
13
  def index
14
- @script_urls = snippet_post.urls.all
14
+ @snippet_urls = snippet_post.urls.all
15
15
  end
16
16
 
17
17
  # SHOW
18
18
  def show
19
- @script_url = snippet_post.urls.find(params[:id])
19
+ @snippet_url = snippet_post.urls.find(params[:id])
20
20
  end
21
21
 
22
22
  # NEW
23
23
  def new
24
- @script_url = snippet_post.urls.build
24
+ @snippet_url = snippet_post.urls.build
25
25
  end
26
26
 
27
27
  # EDIT
@@ -30,11 +30,11 @@ module PhcdevworksScripts
30
30
 
31
31
  # CREATE
32
32
  def create
33
- @script_url = snippet_post.urls.create(script_url_params)
34
- @script_url.user_id = current_user.id
35
- @script_url.org_id = current_user.org_id
36
- if @script_url.save
37
- redirect_to script_snippet_urls_path, :flash => { :success => 'Script url was successfully created.' }
33
+ @snippet_url = snippet_post.urls.create(snippet_url_params)
34
+ @snippet_url.user_id = current_user.id
35
+ @snippet_url.org_id = current_user.org_id
36
+ if @snippet_url.save
37
+ redirect_to snippet_post_urls_path, :flash => { :success => 'Script url was successfully created.' }
38
38
  else
39
39
  render :new
40
40
  end
@@ -42,9 +42,9 @@ module PhcdevworksScripts
42
42
 
43
43
  # UPDATE
44
44
  def update
45
- @script_snippet = Snippet::Url.find(params[:snippet_id])
46
- if @script_url.update(script_url_params)
47
- redirect_to script_snippet_urls_path, :flash => { :success => 'Script url was successfully updated.' }
45
+ @snippet_post = Snippet::Post.friendly.find(params[:post_id])
46
+ if @snippet_url.update(snippet_url_params)
47
+ redirect_to snippet_post_urls_path, :flash => { :success => 'Script url was successfully updated.' }
48
48
  else
49
49
  render :edit
50
50
  end
@@ -52,9 +52,9 @@ module PhcdevworksScripts
52
52
 
53
53
  # DELETE
54
54
  def destroy
55
- @script_url = snippet_post.urls.find(params[:id])
56
- @script_url.destroy
57
- redirect_to script_snippet_urls_path, :flash => { :error => 'Script url was successfully destroyed.' }
55
+ @snippet_url = snippet_post.urls.find(params[:id])
56
+ @snippet_url.destroy
57
+ redirect_to snippet_post_urls_path, :flash => { :error => 'Script url was successfully destroyed.' }
58
58
  end
59
59
 
60
60
  private
@@ -70,7 +70,7 @@ module PhcdevworksScripts
70
70
 
71
71
  # Whitelist
72
72
  def snippet_url_params
73
- params.require(:snippet_url).permit(:snippet_url)
73
+ params.require(:snippet_url).permit(:snippet_url, :post_id, :slug, :user_id, :org_id)
74
74
  end
75
75
 
76
76
  end
@@ -5,7 +5,7 @@ module PhcdevworksScripts
5
5
  extend FriendlyId
6
6
 
7
7
  # Paper Trail Initialize
8
- has_paper_trail :class_name => 'PhcdevworksScripts::AuthorVersions'
8
+ has_paper_trail :class_name => 'PhcdevworksScripts::ScriptAuthorVersions'
9
9
 
10
10
  # Relationships
11
11
  has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing'
@@ -5,7 +5,7 @@ module PhcdevworksScripts
5
5
  extend FriendlyId
6
6
 
7
7
  # Paper Trail Initialize
8
- has_paper_trail :class_name => 'PhcdevworksScripts::ExtensionVersions'
8
+ has_paper_trail :class_name => 'PhcdevworksScripts::ScriptExtensionVersions'
9
9
 
10
10
  # Relationships
11
11
  has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing', :through => :urls
@@ -5,7 +5,7 @@ module PhcdevworksScripts
5
5
  extend FriendlyId
6
6
 
7
7
  # Paper Trail Initialize
8
- has_paper_trail :class_name => 'PhcdevworksScripts::ListingVersions'
8
+ has_paper_trail :class_name => 'PhcdevworksScripts::ScriptListingVersions'
9
9
 
10
10
  # Relationships
11
11
  has_many :urls, class_name: 'PhcdevworksScripts::Script::Url', :dependent => :destroy
@@ -2,7 +2,7 @@ module PhcdevworksScripts
2
2
  class Script::Url < ApplicationRecord
3
3
 
4
4
  # Paper Trail Initialize
5
- has_paper_trail :class_name => 'PhcdevworksScripts::UrlVersions'
5
+ has_paper_trail :class_name => 'PhcdevworksScripts::ScriptUrlVersions'
6
6
 
7
7
  # Relationships
8
8
  belongs_to :listing, class_name: 'PhcdevworksScripts::Script::Listing'
@@ -5,21 +5,21 @@ module PhcdevworksScripts
5
5
  extend FriendlyId
6
6
 
7
7
  # Paper Trail Initialize
8
- has_paper_trail :class_name => 'PhcdevworksScripts::ScriptversionVersions'
8
+ has_paper_trail :class_name => 'PhcdevworksScripts::ScriptVersionVersions'
9
9
 
10
10
  # Relationships
11
11
  has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing', :through => :urls
12
12
  has_many :urls, class_name: 'PhcdevworksScripts::Script::Url'
13
13
 
14
14
  # Form Fields Validation
15
- validates :version_number,
15
+ validates :script_version_number,
16
16
  presence: true
17
17
 
18
18
  # Clean URL Define
19
19
  friendly_id :phcdev_script_version_nice_urls, use: [:slugged, :finders]
20
20
 
21
21
  def phcdev_script_version_nice_urls
22
- [:version_number]
22
+ [:script_version_number]
23
23
  end
24
24
 
25
25
  end
@@ -1,5 +1,5 @@
1
1
  module PhcdevworksScripts
2
- class AuthorVersions < PaperTrail::Version
2
+ class ScriptAuthorVersions < PaperTrail::Version
3
3
  self.table_name = :phcdevworks_scripts_author_versions
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module PhcdevworksScripts
2
- class ExtensionVersions < PaperTrail::Version
2
+ class ScriptExtensionVersions < PaperTrail::Version
3
3
  self.table_name = :phcdevworks_scripts_extension_versions
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module PhcdevworksScripts
2
- class ListingVersions < PaperTrail::Version
2
+ class ScriptListingVersions < PaperTrail::Version
3
3
  self.table_name = :phcdevworks_scripts_listing_versions
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module PhcdevworksScripts
2
- class UrlVersions < PaperTrail::Version
2
+ class ScriptUrlVersions < PaperTrail::Version
3
3
  self.table_name = :phcdevworks_scripts_url_versions
4
4
  end
5
5
  end
@@ -0,0 +1,5 @@
1
+ module PhcdevworksScripts
2
+ class ScriptVersionVersions < PaperTrail::Version
3
+ self.table_name = :phcdevworks_scripts_script_version_versions
4
+ end
5
+ end
@@ -4,8 +4,11 @@ module PhcdevworksScripts
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
6
6
 
7
+ # Paper Trail Initialize
8
+ has_paper_trail :class_name => 'PhcdevworksScripts::SnippetPostVersions'
9
+
7
10
  # Relationships
8
- has_many :urls, class_name: 'PhcdevworksScripts::Script::Url'
11
+ has_many :urls, class_name: 'PhcdevworksScripts::Snippet::Url'
9
12
 
10
13
  # Form Fields Validation
11
14
  validates :snippet_title,
@@ -4,8 +4,11 @@ module PhcdevworksScripts
4
4
  # Include Core Validations
5
5
  phc_domain_regx = URI::regexp(%w(http https))
6
6
 
7
+ # Paper Trail Initialize
8
+ has_paper_trail :class_name => 'PhcdevworksScripts::SnippetUrlVersions'
9
+
7
10
  # Relationships
8
- belongs_to :snippet, class_name: 'PhcdevworksScripts::Script::Snippet'
11
+ belongs_to :post, class_name: 'PhcdevworksScripts::Snippet::Post'
9
12
 
10
13
  # Form Fields Validation
11
14
  validates :snippet_url,
@@ -0,0 +1,5 @@
1
+ module PhcdevworksScripts
2
+ class SnippetPostVersions < PaperTrail::Version
3
+ self.table_name = :phcdevworks_scripts_snippet_post_versions
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module PhcdevworksScripts
2
+ class SnippetUrlVersions < PaperTrail::Version
3
+ self.table_name = :phcdevworks_scripts_snippet_url_versions
4
+ end
5
+ end
@@ -7,8 +7,8 @@
7
7
 
8
8
  <!-- Form Input Fields -->
9
9
  <div class="form-group field_with_errors">
10
- <%= form.label :version_number, "Version Number" %>
11
- <%= form.text_field :version_number, placeholder: "Version Number", class: "form-control" %>
10
+ <%= form.label :script_version_number, "Version Number" %>
11
+ <%= form.text_field :script_version_number, placeholder: "Version Number", class: "form-control" %>
12
12
  </div>
13
13
  <!-- Form Input Fields -->
14
14
 
@@ -45,7 +45,7 @@
45
45
  <tbody>
46
46
  <% @script_versions.each do |script_version| %>
47
47
  <tr>
48
- <td><%= link_to script_version.version_number, script_version %></td>
48
+ <td><%= link_to script_version.script_version_number, script_version %></td>
49
49
  </tr>
50
50
  <% end %>
51
51
  </tbody>
@@ -1,14 +1,14 @@
1
1
  <!-- Form - Script - Script URLs -->
2
- <%= form_with(model: [ @script_snippet, @script_url], url: form_url, local: true) do |form| %>
2
+ <%= form_with(model: [ @script_snippet, @snippet_url], url: form_url, local: true) do |form| %>
3
3
 
4
4
  <!-- PHCNotifi Render Validation -->
5
- <%= render "phcdevworks_notifications/bootstrap/validations", :object => @article_post %>
5
+ <%= render "phcdevworks_notifications/bootstrap/validations", :object => @snippet_url %>
6
6
  <!-- PHCNotifi Render Validation -->
7
7
 
8
8
  <!-- Form Input Fields -->
9
9
  <div class="form-group field_with_errors">
10
- <%= form.label :script_url %>
11
- <%= form.text_field :script_url, placeholder: "Script Url", class: "form-control" %>
10
+ <%= form.label :snippet_url %>
11
+ <%= form.text_field :snippet_url, placeholder: "Script Url", class: "form-control" %>
12
12
  </div>
13
13
  <!-- Form Input Fields -->
14
14
 
@@ -44,14 +44,14 @@
44
44
  </thead>
45
45
 
46
46
  <tbody>
47
- <% @script_urls.each do |script_url| %>
47
+ <% @snippet_urls.each do |snippet_url| %>
48
48
  <tr>
49
- <td><%= script_url.script_url %></td>
49
+ <td><%= snippet_url.snippet_url %></td>
50
50
  <td>
51
51
  <div class="btn-group d-flex" role="group">
52
- <%= link_to "URL Details", snippet_post_url_path(script_url.snippet, script_url), class: "btn btn-purple btn-xs" %>
53
- <%= link_to "Update URL", edit_snippet_post_url_path(script_url.snippet, script_url), class: "btn btn-primary btn-xs" %>
54
- <%= link_to "Remove URL", snippet_post_url_path(script_url.snippet, script_url), method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
52
+ <%= link_to "URL Details", snippet_post_url_path(snippet_url.post, snippet_url), class: "btn btn-purple btn-xs" %>
53
+ <%= link_to "Update URL", edit_snippet_post_url_path(snippet_url.post, snippet_url), class: "btn btn-primary btn-xs" %>
54
+ <%= link_to "Remove URL", snippet_post_url_path(snippet_url.post, snippet_url), method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
55
55
  </div>
56
56
  </td>
57
57
  </tr>
@@ -59,7 +59,7 @@
59
59
  <div class="panel-body">
60
60
  <p class="h3">Script Snippet URL</p>
61
61
  <hr>
62
- <pre><code><%= @script_url.script_url %></code></pre>
62
+ <pre><code><%= @snippet_url.snippet_url %></code></pre>
63
63
  </div>
64
64
  <!-- Panel Body -->
65
65
  </div>
data/config/routes.rb CHANGED
@@ -1,53 +1,32 @@
1
1
  PhcdevworksScripts::Engine.routes.draw do
2
2
 
3
- namespace :snippet do
4
- resources :urls
5
- end
6
- namespace :snippet do
7
- resources :posts
8
- end
9
- namespace :script do
10
- resources :versions
11
- end
12
- namespace :script do
13
- resources :urls
14
- end
15
- namespace :script do
16
- resources :listings
17
- end
18
- namespace :script do
19
- resources :extensions
20
- end
21
- namespace :script do
22
- resources :authors
23
- end
24
3
  # API Routes
25
4
  namespace :api, :path => "", :constraints => {:subdomain => "api"} do
26
5
  namespace :v1 do
27
- resources :mains, defaults: {format: 'json'}
28
- resources :informations, defaults: {format: 'json'}
29
- resources :versions, defaults: {format: 'json'}
6
+ resources :mains, defaults: {format: "json"}
7
+ resources :informations, defaults: {format: "json"}
8
+ resources :versions, defaults: {format: "json"}
30
9
  end
31
10
  end
32
11
 
33
12
  # Script CDN Routes
34
13
  namespace :script do
35
- resources :listings, class_name: 'PhcdevworksScripts::Script::Listing' do
36
- resources :urls, class_name: 'PhcdevworksScripts::Script::Url'
14
+ resources :listings, class_name: "PhcdevworksScripts::Script::Listing" do
15
+ resources :urls, class_name: "PhcdevworksScripts::Script::Url"
37
16
  end
38
- resources :authors, class_name: 'PhcdevworksScripts::Script::Author'
39
- resources :extensions, class_name: 'PhcdevworksScripts::Script::Extension'
40
- resources :versions, class_name: 'PhcdevworksScripts::Script::Version'
17
+ resources :authors, class_name: "PhcdevworksScripts::Script::Author"
18
+ resources :extensions, class_name: "PhcdevworksScripts::Script::Extension"
19
+ resources :versions, class_name: "PhcdevworksScripts::Script::Version"
41
20
  end
42
21
 
43
22
  # Script Snippet Routes
44
23
  namespace :snippet do
45
- resources :posts, class_name: 'PhcdevworksScripts::Snippet::Post' do
46
- resources :urls, class_name: 'PhcdevworksScripts::Snippet::Url'
24
+ resources :posts, class_name: "PhcdevworksScripts::Snippet::Post" do
25
+ resources :urls, class_name: "PhcdevworksScripts::Snippet::Url"
47
26
  end
48
27
  end
49
28
 
50
29
  # Mount Routes
51
- mount PhcdevworksAccounts::Engine, :at => '/'
30
+ mount PhcdevworksAccounts::Engine, :at => "/"
52
31
 
53
32
  end
@@ -1,4 +1,4 @@
1
- class CreatePhcdevworksScriptsExtensionVersions < ActiveRecord::Migration[5.2]
1
+ class CreatePhcdevworksScriptsExtensionVersions < ActiveRecord::Migration[6.0]
2
2
  TEXT_BYTES = 1_073_741_823
3
3
  def change
4
4
 
@@ -11,7 +11,7 @@ class CreatePhcdevworksScriptsExtensionVersions < ActiveRecord::Migration[5.2]
11
11
  t.datetime :created_at
12
12
  end
13
13
 
14
- add_index :phcdevworks_scripts_extension_versions, %i(item_type item_id), :name => 'scriptcdnpro_ext_versions'
14
+ add_index :phcdevworks_scripts_extension_versions, %i(item_type item_id), :name => 'script_ext_versions'
15
15
 
16
16
  end
17
17
  end
@@ -1,4 +1,4 @@
1
- class CreatePhcdevworksScriptsListingVersions < ActiveRecord::Migration[5.2]
1
+ class CreatePhcdevworksScriptsListingVersions < ActiveRecord::Migration[6.0]
2
2
  TEXT_BYTES = 1_073_741_823
3
3
  def change
4
4
 
@@ -11,7 +11,7 @@ class CreatePhcdevworksScriptsListingVersions < ActiveRecord::Migration[5.2]
11
11
  t.datetime :created_at
12
12
  end
13
13
 
14
- add_index :phcdevworks_scripts_listing_versions, %i(item_type item_id), :name => 'scriptcdnpro_listing_versions'
14
+ add_index :phcdevworks_scripts_listing_versions, %i(item_type item_id), :name => 'script_listing_versions'
15
15
 
16
16
  end
17
17
  end
@@ -0,0 +1,17 @@
1
+ class CreatePhcdevworksScriptsScriptVersionVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_scripts_script_version_versions do |t|
6
+ t.string :item_type, {:null=>false}
7
+ t.integer :item_id, null: false
8
+ t.string :event, null: false
9
+ t.string :whodunnit
10
+ t.text :object, limit: TEXT_BYTES
11
+ t.datetime :created_at
12
+ end
13
+
14
+ add_index :phcdevworks_scripts_script_version_versions, %i(item_type item_id), :name => 'script_version_versions'
15
+
16
+ end
17
+ end
@@ -1,4 +1,4 @@
1
- class CreatePhcdevworksScriptsUrlVersions < ActiveRecord::Migration[5.2]
1
+ class CreatePhcdevworksScriptsUrlVersions < ActiveRecord::Migration[6.0]
2
2
  TEXT_BYTES = 1_073_741_823
3
3
  def change
4
4
 
@@ -11,7 +11,7 @@ class CreatePhcdevworksScriptsUrlVersions < ActiveRecord::Migration[5.2]
11
11
  t.datetime :created_at
12
12
  end
13
13
 
14
- add_index :phcdevworks_scripts_url_versions, %i(item_type item_id), :name => 'scriptcdnpro_url_versions'
14
+ add_index :phcdevworks_scripts_url_versions, %i(item_type item_id), :name => 'script_url_versions'
15
15
 
16
16
  end
17
17
  end
@@ -1,4 +1,4 @@
1
- class CreatePhcdevworksScriptsAuthorVersions < ActiveRecord::Migration[5.2]
1
+ class CreatePhcdevworksScriptsAuthorVersions < ActiveRecord::Migration[6.0]
2
2
  TEXT_BYTES = 1_073_741_823
3
3
  def change
4
4
 
@@ -11,7 +11,7 @@ class CreatePhcdevworksScriptsAuthorVersions < ActiveRecord::Migration[5.2]
11
11
  t.datetime :created_at
12
12
  end
13
13
 
14
- add_index :phcdevworks_scripts_author_versions, %i(item_type item_id), :name => 'scriptcdnpro_author_versions'
14
+ add_index :phcdevworks_scripts_author_versions, %i(item_type item_id), :name => 'script_author_versions'
15
15
 
16
16
  end
17
17
  end
@@ -1,4 +1,4 @@
1
- class CreatePhcdevworksScriptsLicenceVersions < ActiveRecord::Migration[5.2]
1
+ class CreatePhcdevworksScriptsLicenceVersions < ActiveRecord::Migration[6.0]
2
2
  TEXT_BYTES = 1_073_741_823
3
3
  def change
4
4
 
@@ -11,7 +11,7 @@ class CreatePhcdevworksScriptsLicenceVersions < ActiveRecord::Migration[5.2]
11
11
  t.datetime :created_at
12
12
  end
13
13
 
14
- add_index :phcdevworks_scripts_licence_versions, %i(item_type item_id), :name => 'scriptcdnpro_licence_versions'
14
+ add_index :phcdevworks_scripts_licence_versions, %i(item_type item_id), :name => 'script_licence_versions'
15
15
 
16
16
  end
17
17
  end
@@ -2,7 +2,7 @@ class CreatePhcdevworksScriptsScriptVersions < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  create_table :phcdevworks_scripts_script_versions do |t|
4
4
 
5
- t.string :version_number
5
+ t.string :script_version_number
6
6
 
7
7
  t.string :slug
8
8
  t.string :user_id
@@ -1,17 +1,19 @@
1
- class CreatePhcdevworksScriptsScriptversionVersions < ActiveRecord::Migration[5.2]
1
+ class CreatePhcdevworksScriptsSnippetUrlVersions < ActiveRecord::Migration[6.0]
2
2
  TEXT_BYTES = 1_073_741_823
3
3
  def change
4
4
 
5
- create_table :phcdevworks_scripts_scriptversion_versions do |t|
5
+ create_table :phcdevworks_scripts_snippet_url_versions do |t|
6
+
6
7
  t.string :item_type, {:null=>false}
7
8
  t.integer :item_id, null: false
8
9
  t.string :event, null: false
9
10
  t.string :whodunnit
10
11
  t.text :object, limit: TEXT_BYTES
11
12
  t.datetime :created_at
13
+
12
14
  end
13
15
 
14
- add_index :phcdevworks_scripts_scriptversion_versions, %i(item_type item_id), :name => 'scriptcdnpro_scriptversion_versions'
16
+ add_index :phcdevworks_scripts_snippet_url_versions, %i(item_type item_id), :name => 'snippet_url_versions'
15
17
 
16
18
  end
17
19
  end
@@ -0,0 +1,19 @@
1
+ class CreatePhcdevworksScriptsSnippetPostVersions < ActiveRecord::Migration[6.0]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcdevworks_scripts_snippet_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_scripts_snippet_post_versions, %i(item_type item_id), :name => 'snippet_post_versions'
17
+
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksScripts
2
- VERSION = "3.0.1"
2
+ VERSION = "4.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcdevworks_scripts
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 4.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
@@ -286,20 +286,22 @@ files:
286
286
  - app/jobs/phcdevworks_scripts/application_job.rb
287
287
  - app/mailers/phcdevworks_scripts/application_mailer.rb
288
288
  - app/models/phcdevworks_scripts/application_record.rb
289
- - app/models/phcdevworks_scripts/author_versions.rb
290
- - app/models/phcdevworks_scripts/extension_versions.rb
291
- - app/models/phcdevworks_scripts/listing_versions.rb
292
289
  - app/models/phcdevworks_scripts/script.rb
293
290
  - app/models/phcdevworks_scripts/script/author.rb
294
291
  - app/models/phcdevworks_scripts/script/extension.rb
295
292
  - app/models/phcdevworks_scripts/script/listing.rb
296
293
  - app/models/phcdevworks_scripts/script/url.rb
297
294
  - app/models/phcdevworks_scripts/script/version.rb
298
- - app/models/phcdevworks_scripts/scriptversion_versions.rb
295
+ - app/models/phcdevworks_scripts/script_author_versions.rb
296
+ - app/models/phcdevworks_scripts/script_extension_versions.rb
297
+ - app/models/phcdevworks_scripts/script_listing_versions.rb
298
+ - app/models/phcdevworks_scripts/script_url_versions.rb
299
+ - app/models/phcdevworks_scripts/script_version_versions.rb
299
300
  - app/models/phcdevworks_scripts/snippet.rb
300
301
  - app/models/phcdevworks_scripts/snippet/post.rb
301
302
  - app/models/phcdevworks_scripts/snippet/url.rb
302
- - app/models/phcdevworks_scripts/url_versions.rb
303
+ - app/models/phcdevworks_scripts/snippet_post_versions.rb
304
+ - app/models/phcdevworks_scripts/snippet_url_versions.rb
303
305
  - app/views/layouts/phcdevworks_scripts/application.html.erb
304
306
  - app/views/layouts/phcdevworks_scripts/components/backend/footer/_footer.html.erb
305
307
  - app/views/layouts/phcdevworks_scripts/components/backend/navigation/_top_menu.html.erb
@@ -342,7 +344,7 @@ files:
342
344
  - config/routes.rb
343
345
  - db/migrate/20170517064030_create_phcdevworks_scripts_extension_versions.rb
344
346
  - db/migrate/20170517064049_create_phcdevworks_scripts_listing_versions.rb
345
- - db/migrate/20170517064114_create_phcdevworks_scripts_scriptversion_versions.rb
347
+ - db/migrate/20170517064114_create_phcdevworks_scripts_script_version_versions.rb
346
348
  - db/migrate/20170517064150_create_phcdevworks_scripts_url_versions.rb
347
349
  - db/migrate/20170517064208_create_phcdevworks_scripts_author_versions.rb
348
350
  - db/migrate/20170517064427_create_phcdevworks_scripts_licence_versions.rb
@@ -353,6 +355,8 @@ files:
353
355
  - db/migrate/20190818023709_create_phcdevworks_scripts_script_extensions.rb
354
356
  - db/migrate/20190818023911_create_phcdevworks_scripts_script_urls.rb
355
357
  - db/migrate/20190818031653_create_phcdevworks_scripts_script_versions.rb
358
+ - db/migrate/20191102092649_create_phcdevworks_scripts_snippet_url_versions.rb
359
+ - db/migrate/20191102092711_create_phcdevworks_scripts_snippet_post_versions.rb
356
360
  - lib/phcdevworks_scripts.rb
357
361
  - lib/phcdevworks_scripts/engine.rb
358
362
  - lib/phcdevworks_scripts/version.rb
@@ -1,5 +0,0 @@
1
- module PhcdevworksScripts
2
- class ScriptversionVersions < PaperTrail::Version
3
- self.table_name = :phcdevworks_scripts_scriptversion_versions
4
- end
5
- end