phcscriptcdnpro 14.1.0 → 15.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/phcscriptcdnpro/author_versions.rb +5 -0
  3. data/app/models/phcscriptcdnpro/extension_versions.rb +5 -0
  4. data/app/models/phcscriptcdnpro/licence_versions.rb +5 -0
  5. data/app/models/phcscriptcdnpro/listing_versions.rb +5 -0
  6. data/app/models/phcscriptcdnpro/script/author.rb +4 -4
  7. data/app/models/phcscriptcdnpro/script/extension.rb +20 -3
  8. data/app/models/phcscriptcdnpro/script/licence.rb +20 -3
  9. data/app/models/phcscriptcdnpro/script/listing.rb +10 -9
  10. data/app/models/phcscriptcdnpro/script/url.rb +19 -7
  11. data/app/models/phcscriptcdnpro/script/version.rb +20 -5
  12. data/app/models/phcscriptcdnpro/scriptversion_versions.rb +5 -0
  13. data/app/models/phcscriptcdnpro/url_versions.rb +5 -0
  14. data/config/initializers/friendly_id.rb +3 -3
  15. data/config/initializers/locale.rb +10 -0
  16. data/config/initializers/paper_trail.rb +1 -0
  17. data/db/migrate/20170509002355_create_phcscriptcdnpro_friendly_id_slugs.rb +18 -0
  18. data/db/migrate/20170517064030_create_phcscriptcdnpro_extensions_versions.rb +17 -0
  19. data/db/migrate/20170517064049_create_phcscriptcdnpro_listings_versions.rb +16 -0
  20. data/db/migrate/20170517064114_create_phcscriptcdnpro_scriptversion_versions.rb +16 -0
  21. data/db/migrate/20170517064114_create_phcscriptcdnpro_url_versions.rb +16 -0
  22. data/db/migrate/20170517064208_create_phcscriptcdnpro_author_versions.rb +16 -0
  23. data/db/migrate/20170517064427_create_phcscriptcdnpro_licence_versions.rb +16 -0
  24. data/lib/phcscriptcdnpro/version.rb +1 -1
  25. metadata +17 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 425c3171e7a32cd56800086e6950a202c377d8c9
4
- data.tar.gz: 574a9e043c2b2b9d73fc1b53e2e8a3518ce9278a
3
+ metadata.gz: 36356094c24f210c444e923c5c90c8e2201569ea
4
+ data.tar.gz: 005be6943ae2c74df4db5c25092b93fa051f2761
5
5
  SHA512:
6
- metadata.gz: 3ab6040548e02d87069ce6d0caa16e371e53d31de1e861a8fcc09d07d0491337fa2952fe9d9dfbcd8d58a14b326d6afafc0bd947eb6675e3526d5b7c6cd6a3ea
7
- data.tar.gz: 3419ebc660bd014dec6cc7e109f1185b221df0e2a1f2cd5e1f2c42c0da4e027cb7e51fdfb85c9c5e11ec81b8622c62471064e91cff4fed958be6fb6e0d4aaf3b
6
+ metadata.gz: d43bf1c8bcc1703c36e693644346679dc5df509d185a9f26c3fc2112285e1221d79485c047d7d460512d53af03f895680f76df34b75e6a0aab05b446d0b97b83
7
+ data.tar.gz: 94694fbe4771a422ee8383191841b0de76df87ffff17bc36d749dd156dd7338f876a919ace0d5f0461b4553a2767a0a91b3b1c0256bcb9ea2390cdb019c126a8
@@ -0,0 +1,5 @@
1
+ module Phcscriptcdnpro
2
+ class AuthorVersions < PaperTrail::Version
3
+ self.table_name = :phcscriptcdnpro_author_versions
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Phcscriptcdnpro
2
+ class ExtensionVersions < PaperTrail::Version
3
+ self.table_name = :phcscriptcdnpro_extension_versions
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Phcscriptcdnpro
2
+ class LicenceVersions < PaperTrail::Version
3
+ self.table_name = :phcscriptcdnpro_licence_versions
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Phcscriptcdnpro
2
+ class ListingVersions < PaperTrail::Version
3
+ self.table_name = :phcscriptcdnpro_listing_versions
4
+ end
5
+ end
@@ -5,16 +5,16 @@ module Phcscriptcdnpro
5
5
  extend FriendlyId
6
6
 
7
7
  # Add Paper Trail
8
- has_paper_trail
8
+ has_paper_trail :class_name => 'Phcscriptcdnpro::AuthorVersions'
9
9
 
10
- # Model Relationships
10
+ # Relationships
11
11
  has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing'
12
12
 
13
13
  # Clean URL Define
14
- friendly_id :scriptcdn_author_slug, use: :slugged
14
+ friendly_id :phcscriptcdnpro_author_slug, use: [:slugged, :finders]
15
15
 
16
16
  # Define for Multiple Records
17
- def scriptcdn_author_slug
17
+ def phcscriptcdnpro_author_slug
18
18
  [
19
19
  [:authorfirstname, :authorlastname]
20
20
  ]
@@ -5,14 +5,31 @@ module Phcscriptcdnpro
5
5
  extend FriendlyId
6
6
 
7
7
  # Add Paper Trail
8
- has_paper_trail
8
+ has_paper_trail :class_name => 'Phcscriptcdnpro::ExtensionVersions'
9
9
 
10
- # Model Relationships
10
+ # Relationships
11
11
  has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing', :through => :urls
12
12
  has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
13
13
 
14
+ # Validation for Form Fields
15
+ validates :scriptextensionname,
16
+ presence: true
17
+
18
+ validates :scriptextensiondes,
19
+ presence: true
20
+
21
+ validates :scriptextension,
22
+ presence: true
23
+
14
24
  # Clean URL Define
15
- friendly_id :scriptextensionname, use: :slugged
25
+ friendly_id :phcscriptcdnpro_extentension_slug, use: [:slugged, :finders]
26
+
27
+ # Define for Multiple Records
28
+ def phcscriptcdnpro_extentension_slug
29
+ [
30
+ [:scriptextensionname, :scriptextension]
31
+ ]
32
+ end
16
33
 
17
34
  end
18
35
  end
@@ -5,13 +5,30 @@ module Phcscriptcdnpro
5
5
  extend FriendlyId
6
6
 
7
7
  # Add Paper Trail
8
- has_paper_trail
8
+ has_paper_trail :class_name => 'Phcscriptcdnpro::LicenceVersions'
9
9
 
10
- # Model Relationships
10
+ # Relationships
11
11
  has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing'
12
12
 
13
+ # Validation for Form Fields
14
+ validates :lcncname,
15
+ presence: true
16
+
17
+ validates :lcncdescript,
18
+ presence: true
19
+
20
+ validates :lcncdescription,
21
+ presence: true
22
+
13
23
  # Clean URL Define
14
- friendly_id :lcncname, use: :slugged
24
+ friendly_id :phcscriptcdnpro_licence_slug, use: [:slugged, :finders]
25
+
26
+ # Define for Multiple Records
27
+ def phcscriptcdnpro_licence_slug
28
+ [
29
+ [:lcncname]
30
+ ]
31
+ end
15
32
 
16
33
  end
17
34
  end
@@ -5,22 +5,23 @@ module Phcscriptcdnpro
5
5
  extend FriendlyId
6
6
 
7
7
  # Add Paper Trail
8
- has_paper_trail
8
+ has_paper_trail :class_name => 'Phcscriptcdnpro::ListingVersions'
9
9
 
10
- # Model Relationships
10
+ # Relationships
11
11
  has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
12
-
13
- # Attach to Author (None Nested)
14
12
  belongs_to :author, class_name: 'Phcscriptcdnpro::Script::Author'
15
-
16
- # Attach to Version (None Nested)
17
13
  belongs_to :version, class_name: 'Phcscriptcdnpro::Script::Version'
18
-
19
- # Attach to Licence (None Nested)
20
14
  belongs_to :licence, class_name: 'Phcscriptcdnpro::Script::Licence'
21
15
 
22
16
  # Clean URL Define
23
- friendly_id :scripttitle, use: :slugged
17
+ friendly_id :phcscriptcdnpro_listing_slug, use: [:slugged, :finders]
18
+
19
+ # Define for Multiple Records
20
+ def phcscriptcdnpro_listing_slug
21
+ [
22
+ [:scripttitle]
23
+ ]
24
+ end
24
25
 
25
26
  end
26
27
  end
@@ -5,20 +5,32 @@ module Phcscriptcdnpro
5
5
  extend FriendlyId
6
6
 
7
7
  # Add Paper Trail
8
- has_paper_trail
8
+ has_paper_trail :class_name => 'Phcscriptcdnpro::UrlVersions'
9
9
 
10
- # Model Relationships
10
+ # Relationships
11
11
  belongs_to :listing, class_name: 'Phcscriptcdnpro::Script::Listing'
12
-
13
- # Attach to Version (None Nested)
14
12
  belongs_to :version, class_name: 'Phcscriptcdnpro::Script::Version'
15
-
16
- # Attach to Extension (None Nested)
17
13
  belongs_to :extension, class_name: 'Phcscriptcdnpro::Script::Extension'
18
14
 
15
+ # Validation for Form Fields
16
+ validates :scripturl,
17
+ presence: true
18
+
19
+ validates :scripturlrelease,
20
+ presence: true
21
+
22
+ validates :scripturlcdnupdate,
23
+ presence: true
19
24
 
20
25
  # Clean URL Define
21
- friendly_id :id, use: :slugged
26
+ friendly_id :phcscriptcdnpro_url_slug, use: [:slugged, :finders]
27
+
28
+ # Define for Multiple Records
29
+ def phcscriptcdnpro_url_slug
30
+ [
31
+ [:scripturl]
32
+ ]
33
+ end
22
34
 
23
35
  end
24
36
  end
@@ -5,16 +5,31 @@ module Phcscriptcdnpro
5
5
  extend FriendlyId
6
6
 
7
7
  # Add Paper Trail
8
- has_paper_trail
8
+ has_paper_trail :class_name => 'Phcscriptcdnpro::UrlVersions'
9
9
 
10
- # Model Relationships
10
+ # Relationships
11
11
  has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing'
12
-
13
- # Attach to URL (None Nested)
14
12
  has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url'
15
13
 
14
+ # Validation for Form Fields
15
+ validates :scripturl,
16
+ presence: true
17
+
18
+ validates :scripturlrelease,
19
+ presence: true
20
+
21
+ validates :scripturlcdnupdate,
22
+ presence: true
23
+
16
24
  # Clean URL Define
17
- friendly_id :scriptversion, use: :slugged
25
+ friendly_id :phcscriptcdnpro_url_slug, use: [:slugged, :finders]
26
+
27
+ # Define for Multiple Records
28
+ def phcscriptcdnpro_url_slug
29
+ [
30
+ [:scripturl]
31
+ ]
32
+ end
18
33
 
19
34
  end
20
35
  end
@@ -0,0 +1,5 @@
1
+ module Phcscriptcdnpro
2
+ class ScriptversionVersions < PaperTrail::Version
3
+ self.table_name = :phcscriptcdnpro_scriptversion_versions
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Phcscriptcdnpro
2
+ class UrlVersions < PaperTrail::Version
3
+ self.table_name = :phcscriptcdnpro_url_versions
4
+ end
5
+ end
@@ -17,7 +17,7 @@ FriendlyId.defaults do |config|
17
17
  config.use :reserved
18
18
 
19
19
  config.reserved_words = %w(new edit index session login logout users admin
20
- stylesheets assets javascripts images)
20
+ stylesheets assets javascripts images)
21
21
 
22
22
  # ## Friendly Finders
23
23
  #
@@ -38,14 +38,14 @@ FriendlyId.defaults do |config|
38
38
  # performance because it will avoid Rails-internal code that makes runtime
39
39
  # calls to `Module.extend`.
40
40
  #
41
- # config.use :finders
41
+ config.use :finders
42
42
  #
43
43
  # ## Slugs
44
44
  #
45
45
  # Most applications will use the :slugged module everywhere. If you wish
46
46
  # to do so, uncomment the following line.
47
47
  #
48
- # config.use :slugged
48
+ config.use :slugged
49
49
  #
50
50
  # By default, FriendlyId's :slugged addon expects the slug column to be named
51
51
  # 'slug', but you can change it if you wish.
@@ -0,0 +1,10 @@
1
+ # config/initializers/locale.rb
2
+
3
+ # Where the I18n library should search for translation files
4
+ I18n.load_path += Dir[Rails.root.join('lib', 'locale', '*.{rb,yml}')]
5
+
6
+ # Whitelist locales available for the application
7
+ I18n.available_locales = [:en, :pt]
8
+
9
+ # Set default locale to something other than :en
10
+ I18n.default_locale = :en
@@ -0,0 +1 @@
1
+ PaperTrail.config.track_associations = false
@@ -0,0 +1,18 @@
1
+ class CreatePhcscriptcdnproFriendlyIdSlugs < ActiveRecord::Migration[5.1]
2
+ def change
3
+
4
+ create_table :phcscriptcdnpro_friendly_id_slugs do |t|
5
+ t.string :slug, :null => false
6
+ t.integer :sluggable_id, :null => false
7
+ t.string :sluggable_type, :limit => 50
8
+ t.string :scope
9
+ t.datetime :created_at
10
+ end
11
+
12
+ add_index :phcscriptcdnpro_friendly_id_slugs, :sluggable_id
13
+ add_index :phcscriptcdnpro_friendly_id_slugs, [:slug, :sluggable_type], length: { slug: 140, sluggable_type: 50 }
14
+ add_index :phcscriptcdnpro_friendly_id_slugs, [:slug, :sluggable_type, :scope], name: 'scriptcdnpro_fri_id_slugable_scope_type', length: { slug: 70, sluggable_type: 50, scope: 70 }, unique: true
15
+ add_index :phcscriptcdnpro_friendly_id_slugs, :sluggable_type
16
+
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ class CreatePhcscriptcdnproExtensionsVersions < ActiveRecord::Migration[5.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcscriptcdnpro_extensions_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 :phcscriptcdnpro_extensions_versions, %i(item_type item_id), :name => 'scriptcdnpro_ext_versions'
15
+
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ class CreatePhcscriptcdnproListingVersions < ActiveRecord::Migration[5.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcscriptcdnpro_listing_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
+ add_index :phcscriptcdnpro_listing_versions, %i(item_type item_id), :name => 'scriptcdnpro_listing_versions'
14
+
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreatePhcscriptcdnproScriptversionVersions < ActiveRecord::Migration[5.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcscriptcdnpro_address_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
+ add_index :phcscriptcdnpro_address_versions, %i(item_type item_id), :name => 'scriptcdnpro_address_versions'
14
+
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreatePhcscriptcdnproUrlVersions < ActiveRecord::Migration[5.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcscriptcdnpro_url_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
+ add_index :phcscriptcdnpro_url_versions, %i(item_type item_id), :name => 'scriptcdnpro_url_versions'
14
+
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreatePhcscriptcdnproAuthorVersions < ActiveRecord::Migration[5.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcscriptcdnpro_author_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
+ add_index :phcscriptcdnpro_author_versions, %i(item_type item_id), :name => 'scriptcdnpro_author_versions'
14
+
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreatePhcscriptcdnproLicenceVersions < ActiveRecord::Migration[5.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcscriptcdnpro_licence_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
+ add_index :phcscriptcdnpro_licence_versions, %i(item_type item_id), :name => 'scriptcdnpro_licence_versions'
14
+
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Phcscriptcdnpro
2
- VERSION = "14.1.0"
2
+ VERSION = "15.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcscriptcdnpro
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.1.0
4
+ version: 15.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-11 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -745,8 +745,12 @@ files:
745
745
  - app/jobs/phcscriptcdnpro/application_job.rb
746
746
  - app/mailers/phcscriptcdnpro/application_mailer.rb
747
747
  - app/models/phcscriptcdnpro/application_record.rb
748
+ - app/models/phcscriptcdnpro/author_versions.rb
749
+ - app/models/phcscriptcdnpro/extension_versions.rb
748
750
  - app/models/phcscriptcdnpro/frontend.rb
749
751
  - app/models/phcscriptcdnpro/frontend/listing.rb
752
+ - app/models/phcscriptcdnpro/licence_versions.rb
753
+ - app/models/phcscriptcdnpro/listing_versions.rb
750
754
  - app/models/phcscriptcdnpro/script.rb
751
755
  - app/models/phcscriptcdnpro/script/author.rb
752
756
  - app/models/phcscriptcdnpro/script/extension.rb
@@ -754,6 +758,8 @@ files:
754
758
  - app/models/phcscriptcdnpro/script/listing.rb
755
759
  - app/models/phcscriptcdnpro/script/url.rb
756
760
  - app/models/phcscriptcdnpro/script/version.rb
761
+ - app/models/phcscriptcdnpro/scriptversion_versions.rb
762
+ - app/models/phcscriptcdnpro/url_versions.rb
757
763
  - app/views/layouts/phcscriptcdnpro/application.html.erb
758
764
  - app/views/layouts/phcscriptcdnpro/components/backend/footer/_footer.html.erb
759
765
  - app/views/layouts/phcscriptcdnpro/components/backend/navigation/_top_bar.html.erb
@@ -793,6 +799,8 @@ files:
793
799
  - app/views/phcscriptcdnpro/script/versions/new.html.erb
794
800
  - app/views/phcscriptcdnpro/script/versions/show.html.erb
795
801
  - config/initializers/friendly_id.rb
802
+ - config/initializers/locale.rb
803
+ - config/initializers/paper_trail.rb
796
804
  - config/routes.rb
797
805
  - db/migrate/20160821183652_create_phcscriptcdnpro_script_listings.rb
798
806
  - db/migrate/20160821183714_create_phcscriptcdnpro_script_authors.rb
@@ -800,6 +808,13 @@ files:
800
808
  - db/migrate/20160821183805_create_phcscriptcdnpro_script_licences.rb
801
809
  - db/migrate/20160821183830_create_phcscriptcdnpro_script_urls.rb
802
810
  - db/migrate/20160821183946_create_phcscriptcdnpro_script_versions.rb
811
+ - db/migrate/20170509002355_create_phcscriptcdnpro_friendly_id_slugs.rb
812
+ - db/migrate/20170517064030_create_phcscriptcdnpro_extensions_versions.rb
813
+ - db/migrate/20170517064049_create_phcscriptcdnpro_listings_versions.rb
814
+ - db/migrate/20170517064114_create_phcscriptcdnpro_scriptversion_versions.rb
815
+ - db/migrate/20170517064114_create_phcscriptcdnpro_url_versions.rb
816
+ - db/migrate/20170517064208_create_phcscriptcdnpro_author_versions.rb
817
+ - db/migrate/20170517064427_create_phcscriptcdnpro_licence_versions.rb
803
818
  - lib/phcscriptcdnpro.rb
804
819
  - lib/phcscriptcdnpro/engine.rb
805
820
  - lib/phcscriptcdnpro/version.rb