phcdevworks_scripts 8.1.0 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +3 -28
- data/app/assets/config/phcdevworks_scripts_manifest.js +2 -3
- data/app/controllers/phcdevworks_scripts/application_controller.rb +13 -13
- data/app/controllers/phcdevworks_scripts/script/authors_controller.rb +83 -83
- data/app/controllers/phcdevworks_scripts/script/extensions_controller.rb +83 -83
- data/app/controllers/phcdevworks_scripts/script/listings_controller.rb +83 -83
- data/app/controllers/phcdevworks_scripts/script/urls_controller.rb +78 -78
- data/app/controllers/phcdevworks_scripts/script/versions_controller.rb +83 -83
- data/app/controllers/phcdevworks_scripts/snippet/posts_controller.rb +82 -82
- data/app/controllers/phcdevworks_scripts/snippet/urls_controller.rb +77 -77
- data/app/helpers/phcdevworks_scripts/application_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/authors_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/extensions_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/listings_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/urls_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/script/versions_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/snippet/posts_helper.rb +4 -4
- data/app/helpers/phcdevworks_scripts/snippet/urls_helper.rb +4 -4
- data/app/jobs/phcdevworks_scripts/application_job.rb +4 -4
- data/app/mailers/phcdevworks_scripts/application_mailer.rb +6 -6
- data/app/models/phcdevworks_scripts/application_record.rb +5 -5
- data/app/models/phcdevworks_scripts/script/author.rb +33 -33
- data/app/models/phcdevworks_scripts/script/extension.rb +32 -32
- data/app/models/phcdevworks_scripts/script/listing.rb +38 -38
- data/app/models/phcdevworks_scripts/script/url.rb +24 -24
- data/app/models/phcdevworks_scripts/script/version.rb +26 -26
- data/app/models/phcdevworks_scripts/script.rb +7 -7
- data/app/models/phcdevworks_scripts/snippet/post.rb +28 -28
- data/app/models/phcdevworks_scripts/snippet/url.rb +19 -19
- data/app/models/phcdevworks_scripts/snippet.rb +7 -7
- data/app/models/phcdevworks_scripts/snippet_post_versions.rb +5 -5
- data/app/models/phcdevworks_scripts/snippet_url_versions.rb +5 -5
- data/app/views/layouts/phcdevworks_scripts/application.html.erb +58 -116
- data/app/views/layouts/phcdevworks_scripts/components/backend/footer/_footer.html.erb +10 -9
- data/app/views/layouts/phcdevworks_scripts/components/backend/navigation/_top_menu.html.erb +26 -25
- data/app/views/layouts/phcdevworks_scripts/components/backend/sidebars/_side_menu.html.erb +491 -287
- data/app/views/phcdevworks_scripts/script/authors/_form.html.erb +37 -37
- data/app/views/phcdevworks_scripts/script/authors/edit.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/authors/index.html.erb +70 -78
- data/app/views/phcdevworks_scripts/script/authors/new.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/authors/show.html.erb +49 -49
- data/app/views/phcdevworks_scripts/script/extensions/_form.html.erb +32 -32
- data/app/views/phcdevworks_scripts/script/extensions/edit.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/extensions/index.html.erb +65 -73
- data/app/views/phcdevworks_scripts/script/extensions/new.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/extensions/show.html.erb +49 -49
- data/app/views/phcdevworks_scripts/script/listings/_form.html.erb +73 -73
- data/app/views/phcdevworks_scripts/script/listings/edit.html.erb +39 -47
- data/app/views/phcdevworks_scripts/script/listings/index.html.erb +68 -76
- data/app/views/phcdevworks_scripts/script/listings/new.html.erb +39 -47
- data/app/views/phcdevworks_scripts/script/listings/show.html.erb +48 -48
- data/app/views/phcdevworks_scripts/script/urls/_form.html.erb +42 -42
- data/app/views/phcdevworks_scripts/script/urls/edit.html.erb +52 -60
- data/app/views/phcdevworks_scripts/script/urls/index.html.erb +68 -76
- data/app/views/phcdevworks_scripts/script/urls/new.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/urls/show.html.erb +49 -49
- data/app/views/phcdevworks_scripts/script/versions/_form.html.erb +22 -22
- data/app/views/phcdevworks_scripts/script/versions/edit.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/versions/index.html.erb +64 -72
- data/app/views/phcdevworks_scripts/script/versions/new.html.erb +41 -49
- data/app/views/phcdevworks_scripts/script/versions/show.html.erb +49 -49
- data/app/views/phcdevworks_scripts/snippet/posts/_form.html.erb +28 -28
- data/app/views/phcdevworks_scripts/snippet/posts/edit.html.erb +39 -47
- data/app/views/phcdevworks_scripts/snippet/posts/index.html.erb +74 -82
- data/app/views/phcdevworks_scripts/snippet/posts/new.html.erb +39 -47
- data/app/views/phcdevworks_scripts/snippet/posts/show.html.erb +71 -71
- data/app/views/phcdevworks_scripts/snippet/urls/_form.html.erb +22 -22
- data/app/views/phcdevworks_scripts/snippet/urls/edit.html.erb +39 -47
- data/app/views/phcdevworks_scripts/snippet/urls/index.html.erb +72 -80
- data/app/views/phcdevworks_scripts/snippet/urls/new.html.erb +39 -47
- data/app/views/phcdevworks_scripts/snippet/urls/show.html.erb +71 -71
- data/config/routes.rb +29 -34
- data/config/spring.rb +1 -1
- data/db/migrate/20170517064030_create_phcdevworks_scripts_script_extension_versions.rb +1 -1
- data/db/migrate/20170517064049_create_phcdevworks_scripts_script_listing_versions.rb +18 -18
- data/db/migrate/20170517064114_create_phcdevworks_scripts_script_version_versions.rb +18 -18
- data/db/migrate/20170517064150_create_phcdevworks_scripts_script_url_versions.rb +1 -1
- data/db/migrate/20170517064208_create_phcdevworks_scripts_script_author_versions.rb +18 -18
- data/db/migrate/20190818022002_create_phcdevworks_scripts_snippet_posts.rb +18 -18
- data/db/migrate/20190818022024_create_phcdevworks_scripts_snippet_urls.rb +17 -17
- data/db/migrate/20190818022939_create_phcdevworks_scripts_script_authors.rb +18 -18
- data/db/migrate/20190818023353_create_phcdevworks_scripts_script_listings.rb +29 -29
- data/db/migrate/20190818023709_create_phcdevworks_scripts_script_extensions.rb +17 -17
- data/db/migrate/20190818023911_create_phcdevworks_scripts_script_urls.rb +21 -21
- data/db/migrate/20190818031653_create_phcdevworks_scripts_script_versions.rb +15 -15
- data/db/migrate/20191102092649_create_phcdevworks_scripts_snippet_url_versions.rb +18 -18
- data/db/migrate/20191102092711_create_phcdevworks_scripts_snippet_post_versions.rb +18 -18
- data/lib/phcdevworks_scripts/engine.rb +45 -46
- data/lib/phcdevworks_scripts/version.rb +3 -3
- metadata +36 -87
- data/app/assets/stylesheets/phcdevworks_scripts/application.scss +0 -15
- data/app/assets/stylesheets/phcdevworks_scripts/script/authors.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/extensions.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/listings.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/urls.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/versions.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/snippet/posts.scss +0 -3
- data/app/assets/stylesheets/phcdevworks_scripts/snippet/urls.scss +0 -3
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Script::ListingsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Script::ListingsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Script::UrlsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Script::UrlsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Script::VersionsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Script::VersionsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Snippet::PostsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Snippet::PostsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Snippet::UrlsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Snippet::UrlsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class ApplicationJob < ActiveJob::Base
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class ApplicationJob < ActiveJob::Base
|
3
|
+
end
|
4
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class ApplicationMailer < ActionMailer::Base
|
3
|
-
default from: 'from@example.com'
|
4
|
-
layout 'mailer'
|
5
|
-
end
|
6
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class ApplicationMailer < ActionMailer::Base
|
3
|
+
default from: 'from@example.com'
|
4
|
+
layout 'mailer'
|
5
|
+
end
|
6
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class ApplicationRecord < ActiveRecord::Base
|
3
|
-
self.abstract_class = true
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class ApplicationRecord < ActiveRecord::Base
|
3
|
+
self.abstract_class = true
|
4
|
+
end
|
5
|
+
end
|
@@ -1,33 +1,33 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class Script::Author < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptAuthorVersions'
|
9
|
-
|
10
|
-
# Relationships
|
11
|
-
has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing'
|
12
|
-
|
13
|
-
# Form Fields Validation
|
14
|
-
validates :script_author_first_name,
|
15
|
-
presence: true
|
16
|
-
|
17
|
-
validates :script_author_website,
|
18
|
-
presence: true,
|
19
|
-
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
20
|
-
|
21
|
-
validates :script_author_github,
|
22
|
-
presence: true,
|
23
|
-
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
24
|
-
|
25
|
-
# Clean URL Define
|
26
|
-
friendly_id :script_author_nice_urls, use: [:slugged, :finders]
|
27
|
-
|
28
|
-
def script_author_nice_urls
|
29
|
-
[:script_author_first_name, :script_author_last_name]
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class Script::Author < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptAuthorVersions'
|
9
|
+
|
10
|
+
# Relationships
|
11
|
+
has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing'
|
12
|
+
|
13
|
+
# Form Fields Validation
|
14
|
+
validates :script_author_first_name,
|
15
|
+
presence: true
|
16
|
+
|
17
|
+
validates :script_author_website,
|
18
|
+
presence: true,
|
19
|
+
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
20
|
+
|
21
|
+
validates :script_author_github,
|
22
|
+
presence: true,
|
23
|
+
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
24
|
+
|
25
|
+
# Clean URL Define
|
26
|
+
friendly_id :script_author_nice_urls, use: [:slugged, :finders]
|
27
|
+
|
28
|
+
def script_author_nice_urls
|
29
|
+
[:script_author_first_name, :script_author_last_name]
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class Script::Extension < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptExtensionVersions'
|
9
|
-
|
10
|
-
# Relationships
|
11
|
-
has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing', :through => :urls
|
12
|
-
has_many :urls, class_name: 'PhcdevworksScripts::Script::Url'
|
13
|
-
|
14
|
-
# Form Fields Validation
|
15
|
-
validates :script_extension_name,
|
16
|
-
presence: true
|
17
|
-
|
18
|
-
validates :script_extension_description,
|
19
|
-
presence: true
|
20
|
-
|
21
|
-
validates :script_extension,
|
22
|
-
presence: true
|
23
|
-
|
24
|
-
# Clean URL Define
|
25
|
-
friendly_id :script_extension_nice_urls, use: [:slugged, :finders]
|
26
|
-
|
27
|
-
def script_extension_nice_urls
|
28
|
-
[:script_extension]
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class Script::Extension < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptExtensionVersions'
|
9
|
+
|
10
|
+
# Relationships
|
11
|
+
has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing', :through => :urls
|
12
|
+
has_many :urls, class_name: 'PhcdevworksScripts::Script::Url'
|
13
|
+
|
14
|
+
# Form Fields Validation
|
15
|
+
validates :script_extension_name,
|
16
|
+
presence: true
|
17
|
+
|
18
|
+
validates :script_extension_description,
|
19
|
+
presence: true
|
20
|
+
|
21
|
+
validates :script_extension,
|
22
|
+
presence: true
|
23
|
+
|
24
|
+
# Clean URL Define
|
25
|
+
friendly_id :script_extension_nice_urls, use: [:slugged, :finders]
|
26
|
+
|
27
|
+
def script_extension_nice_urls
|
28
|
+
[:script_extension]
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -1,38 +1,38 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class Script::Listing < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptListingVersions'
|
9
|
-
|
10
|
-
# Relationships
|
11
|
-
has_many :urls, class_name: 'PhcdevworksScripts::Script::Url', :dependent => :destroy
|
12
|
-
belongs_to :author, class_name: 'PhcdevworksScripts::Script::Author'
|
13
|
-
|
14
|
-
# Form Fields Validation
|
15
|
-
validates :script_listing_title,
|
16
|
-
presence: true
|
17
|
-
|
18
|
-
validates :script_listing_description,
|
19
|
-
presence: true
|
20
|
-
|
21
|
-
validates :script_listing_script_source,
|
22
|
-
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
23
|
-
|
24
|
-
validates :script_listing_script_website,
|
25
|
-
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
26
|
-
|
27
|
-
validates :script_listing_script_repo,
|
28
|
-
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
29
|
-
|
30
|
-
# Clean URL Define
|
31
|
-
friendly_id :script_listing_nice_urls, use: [:slugged, :finders]
|
32
|
-
|
33
|
-
def script_listing_nice_urls
|
34
|
-
[:script_listing_title]
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class Script::Listing < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptListingVersions'
|
9
|
+
|
10
|
+
# Relationships
|
11
|
+
has_many :urls, class_name: 'PhcdevworksScripts::Script::Url', :dependent => :destroy
|
12
|
+
belongs_to :author, class_name: 'PhcdevworksScripts::Script::Author'
|
13
|
+
|
14
|
+
# Form Fields Validation
|
15
|
+
validates :script_listing_title,
|
16
|
+
presence: true
|
17
|
+
|
18
|
+
validates :script_listing_description,
|
19
|
+
presence: true
|
20
|
+
|
21
|
+
validates :script_listing_script_source,
|
22
|
+
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
23
|
+
|
24
|
+
validates :script_listing_script_website,
|
25
|
+
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
26
|
+
|
27
|
+
validates :script_listing_script_repo,
|
28
|
+
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
29
|
+
|
30
|
+
# Clean URL Define
|
31
|
+
friendly_id :script_listing_nice_urls, use: [:slugged, :finders]
|
32
|
+
|
33
|
+
def script_listing_nice_urls
|
34
|
+
[:script_listing_title]
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -1,24 +1,24 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class Script::Url < ApplicationRecord
|
3
|
-
|
4
|
-
# Paper Trail Initialize
|
5
|
-
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptUrlVersions'
|
6
|
-
|
7
|
-
# Relationships
|
8
|
-
belongs_to :listing, class_name: 'PhcdevworksScripts::Script::Listing'
|
9
|
-
belongs_to :extension, class_name: 'PhcdevworksScripts::Script::Extension'
|
10
|
-
belongs_to :version, class_name: 'PhcdevworksScripts::Script::Version', optional: true
|
11
|
-
|
12
|
-
# Form Fields Validation
|
13
|
-
validates :script_cdn_url,
|
14
|
-
presence: true,
|
15
|
-
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
16
|
-
|
17
|
-
validates :script_cdn_url_release,
|
18
|
-
presence: true
|
19
|
-
|
20
|
-
validates :script_cdn_url_cdn_update,
|
21
|
-
presence: true
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class Script::Url < ApplicationRecord
|
3
|
+
|
4
|
+
# Paper Trail Initialize
|
5
|
+
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptUrlVersions'
|
6
|
+
|
7
|
+
# Relationships
|
8
|
+
belongs_to :listing, class_name: 'PhcdevworksScripts::Script::Listing'
|
9
|
+
belongs_to :extension, class_name: 'PhcdevworksScripts::Script::Extension'
|
10
|
+
belongs_to :version, class_name: 'PhcdevworksScripts::Script::Version', optional: true
|
11
|
+
|
12
|
+
# Form Fields Validation
|
13
|
+
validates :script_cdn_url,
|
14
|
+
presence: true,
|
15
|
+
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
16
|
+
|
17
|
+
validates :script_cdn_url_release,
|
18
|
+
presence: true
|
19
|
+
|
20
|
+
validates :script_cdn_url_cdn_update,
|
21
|
+
presence: true
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -1,26 +1,26 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class Script::Version < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptVersionVersions'
|
9
|
-
|
10
|
-
# Relationships
|
11
|
-
has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing', :through => :urls
|
12
|
-
has_many :urls, class_name: 'PhcdevworksScripts::Script::Url'
|
13
|
-
|
14
|
-
# Form Fields Validation
|
15
|
-
validates :script_version_number,
|
16
|
-
presence: true
|
17
|
-
|
18
|
-
# Clean URL Define
|
19
|
-
friendly_id :script_version_nice_urls, use: [:slugged, :finders]
|
20
|
-
|
21
|
-
def script_version_nice_urls
|
22
|
-
[:script_version_number]
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class Script::Version < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => 'PhcdevworksScripts::ScriptVersionVersions'
|
9
|
+
|
10
|
+
# Relationships
|
11
|
+
has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing', :through => :urls
|
12
|
+
has_many :urls, class_name: 'PhcdevworksScripts::Script::Url'
|
13
|
+
|
14
|
+
# Form Fields Validation
|
15
|
+
validates :script_version_number,
|
16
|
+
presence: true
|
17
|
+
|
18
|
+
# Clean URL Define
|
19
|
+
friendly_id :script_version_nice_urls, use: [:slugged, :finders]
|
20
|
+
|
21
|
+
def script_version_nice_urls
|
22
|
+
[:script_version_number]
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Script
|
3
|
-
def self.table_name_prefix
|
4
|
-
'phcdevworks_scripts_script_'
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Script
|
3
|
+
def self.table_name_prefix
|
4
|
+
'phcdevworks_scripts_script_'
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|
@@ -1,28 +1,28 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class Snippet::Post < ApplicationRecord
|
3
|
-
|
4
|
-
# Clean URL Initialize
|
5
|
-
extend FriendlyId
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => 'PhcdevworksScripts::SnippetPostVersions'
|
9
|
-
|
10
|
-
# Relationships
|
11
|
-
has_many :urls, class_name: 'PhcdevworksScripts::Snippet::Url'
|
12
|
-
|
13
|
-
# Form Fields Validation
|
14
|
-
validates :snippet_post_title,
|
15
|
-
presence: true
|
16
|
-
|
17
|
-
validates :snippet_post_code,
|
18
|
-
presence: true
|
19
|
-
|
20
|
-
# Clean URL Define
|
21
|
-
friendly_id :snippet_post_nice_urls, use: [:slugged, :finders]
|
22
|
-
|
23
|
-
def snippet_post_nice_urls
|
24
|
-
[:snippet_post_title]
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class Snippet::Post < ApplicationRecord
|
3
|
+
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => 'PhcdevworksScripts::SnippetPostVersions'
|
9
|
+
|
10
|
+
# Relationships
|
11
|
+
has_many :urls, class_name: 'PhcdevworksScripts::Snippet::Url'
|
12
|
+
|
13
|
+
# Form Fields Validation
|
14
|
+
validates :snippet_post_title,
|
15
|
+
presence: true
|
16
|
+
|
17
|
+
validates :snippet_post_code,
|
18
|
+
presence: true
|
19
|
+
|
20
|
+
# Clean URL Define
|
21
|
+
friendly_id :snippet_post_nice_urls, use: [:slugged, :finders]
|
22
|
+
|
23
|
+
def snippet_post_nice_urls
|
24
|
+
[:snippet_post_title]
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class Snippet::Url < ApplicationRecord
|
3
|
-
|
4
|
-
# Include Core Validations
|
5
|
-
phc_domain_regx = URI::regexp(%w(http https))
|
6
|
-
|
7
|
-
# Paper Trail Initialize
|
8
|
-
has_paper_trail :class_name => 'PhcdevworksScripts::SnippetUrlVersions'
|
9
|
-
|
10
|
-
# Relationships
|
11
|
-
belongs_to :post, class_name: 'PhcdevworksScripts::Snippet::Post'
|
12
|
-
|
13
|
-
# Form Fields Validation
|
14
|
-
validates :snippet_post_url,
|
15
|
-
presence: true,
|
16
|
-
format: { :with => phc_domain_regx, message: "Please follow this URL format http or https://www.**********.com" }
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class Snippet::Url < ApplicationRecord
|
3
|
+
|
4
|
+
# Include Core Validations
|
5
|
+
phc_domain_regx = URI::regexp(%w(http https))
|
6
|
+
|
7
|
+
# Paper Trail Initialize
|
8
|
+
has_paper_trail :class_name => 'PhcdevworksScripts::SnippetUrlVersions'
|
9
|
+
|
10
|
+
# Relationships
|
11
|
+
belongs_to :post, class_name: 'PhcdevworksScripts::Snippet::Post'
|
12
|
+
|
13
|
+
# Form Fields Validation
|
14
|
+
validates :snippet_post_url,
|
15
|
+
presence: true,
|
16
|
+
format: { :with => phc_domain_regx, message: "Please follow this URL format http or https://www.**********.com" }
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Snippet
|
3
|
-
def self.table_name_prefix
|
4
|
-
'phcdevworks_scripts_snippet_'
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Snippet
|
3
|
+
def self.table_name_prefix
|
4
|
+
'phcdevworks_scripts_snippet_'
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class SnippetPostVersions < PaperTrail::Version
|
3
|
-
self.table_name = :phcdevworks_scripts_snippet_post_versions
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class SnippetPostVersions < PaperTrail::Version
|
3
|
+
self.table_name = :phcdevworks_scripts_snippet_post_versions
|
4
|
+
end
|
5
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
class SnippetUrlVersions < PaperTrail::Version
|
3
|
-
self.table_name = :phcdevworks_scripts_snippet_url_versions
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
class SnippetUrlVersions < PaperTrail::Version
|
3
|
+
self.table_name = :phcdevworks_scripts_snippet_url_versions
|
4
|
+
end
|
5
|
+
end
|