phcdevworks_scripts 8.1.1 → 8.2.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 +20 -20
- data/README.md +1 -28
- data/Rakefile +8 -8
- data/app/assets/config/phcdevworks_scripts_manifest.js +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/application.scss +15 -15
- data/app/assets/stylesheets/phcdevworks_scripts/script/authors.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/extensions.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/listings.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/urls.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/script/versions.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/snippet/posts.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_scripts/snippet/urls.scss +3 -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/script_author_versions.rb +0 -0
- data/app/models/phcdevworks_scripts/script_extension_versions.rb +0 -0
- data/app/models/phcdevworks_scripts/script_listing_versions.rb +0 -0
- data/app/models/phcdevworks_scripts/script_url_versions.rb +0 -0
- data/app/models/phcdevworks_scripts/script_version_versions.rb +0 -0
- 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 +131 -131
- data/app/views/layouts/phcdevworks_scripts/components/backend/footer/_footer.html.erb +0 -0
- data/app/views/layouts/phcdevworks_scripts/components/backend/navigation/_top_menu.html.erb +0 -0
- data/app/views/layouts/phcdevworks_scripts/components/backend/sidebars/_side_menu.html.erb +0 -0
- data/app/views/phcdevworks_scripts/script/authors/_form.html.erb +37 -37
- data/app/views/phcdevworks_scripts/script/authors/edit.html.erb +49 -49
- data/app/views/phcdevworks_scripts/script/authors/index.html.erb +78 -78
- data/app/views/phcdevworks_scripts/script/authors/new.html.erb +49 -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 +49 -49
- data/app/views/phcdevworks_scripts/script/extensions/index.html.erb +73 -73
- data/app/views/phcdevworks_scripts/script/extensions/new.html.erb +49 -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 +47 -47
- data/app/views/phcdevworks_scripts/script/listings/index.html.erb +76 -76
- data/app/views/phcdevworks_scripts/script/listings/new.html.erb +47 -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 +60 -60
- data/app/views/phcdevworks_scripts/script/urls/index.html.erb +76 -76
- data/app/views/phcdevworks_scripts/script/urls/new.html.erb +49 -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 +49 -49
- data/app/views/phcdevworks_scripts/script/versions/index.html.erb +72 -72
- data/app/views/phcdevworks_scripts/script/versions/new.html.erb +49 -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 +47 -47
- data/app/views/phcdevworks_scripts/snippet/posts/index.html.erb +82 -82
- data/app/views/phcdevworks_scripts/snippet/posts/new.html.erb +47 -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 +47 -47
- data/app/views/phcdevworks_scripts/snippet/urls/index.html.erb +80 -80
- data/app/views/phcdevworks_scripts/snippet/urls/new.html.erb +47 -47
- data/app/views/phcdevworks_scripts/snippet/urls/show.html.erb +71 -71
- data/config/routes.rb +33 -33
- data/config/spring.rb +1 -1
- data/db/migrate/20170517064030_create_phcdevworks_scripts_script_extension_versions.rb +0 -0
- 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 +0 -0
- 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 +47 -47
- data/lib/phcdevworks_scripts/version.rb +3 -3
- data/lib/phcdevworks_scripts.rb +6 -6
- data/lib/tasks/phcdevworks_scripts_tasks.rake +4 -4
- metadata +33 -33
@@ -1,77 +1,77 @@
|
|
1
|
-
require_dependency "phcdevworks_scripts/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksScripts
|
4
|
-
class Snippet::UrlsController < ApplicationController
|
5
|
-
|
6
|
-
# Filters & Security
|
7
|
-
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_paper_trail_whodunnit
|
10
|
-
before_action :set_snippet_url, only: [:show, :edit, :update, :destroy]
|
11
|
-
|
12
|
-
# INDEX
|
13
|
-
def index
|
14
|
-
@snippet_urls = snippet_post.urls.all
|
15
|
-
end
|
16
|
-
|
17
|
-
# SHOW
|
18
|
-
def show
|
19
|
-
@snippet_url = snippet_post.urls.find(params[:id])
|
20
|
-
end
|
21
|
-
|
22
|
-
# NEW
|
23
|
-
def new
|
24
|
-
@snippet_url = snippet_post.urls.build
|
25
|
-
end
|
26
|
-
|
27
|
-
# EDIT
|
28
|
-
def edit
|
29
|
-
end
|
30
|
-
|
31
|
-
# CREATE
|
32
|
-
def create
|
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
|
-
else
|
39
|
-
render :new
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# UPDATE
|
44
|
-
def update
|
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
|
-
else
|
49
|
-
render :edit
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
# DELETE
|
54
|
-
def destroy
|
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
|
-
end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
# Common Callbacks
|
63
|
-
def set_snippet_url
|
64
|
-
@snippet_url = Snippet::Url.find(params[:id])
|
65
|
-
end
|
66
|
-
|
67
|
-
def snippet_post
|
68
|
-
@snippet_post = Snippet::Post.friendly.find(params[:post_id])
|
69
|
-
end
|
70
|
-
|
71
|
-
# Whitelist
|
72
|
-
def snippet_url_params
|
73
|
-
params.require(:snippet_url).permit(:snippet_post_url, :post_id, :slug, :user_id, :org_id)
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
end
|
1
|
+
require_dependency "phcdevworks_scripts/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksScripts
|
4
|
+
class Snippet::UrlsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
#include PhcdevworksCore::PhcpluginsHelper
|
8
|
+
before_action :authenticate_user!
|
9
|
+
before_action :set_paper_trail_whodunnit
|
10
|
+
before_action :set_snippet_url, only: [:show, :edit, :update, :destroy]
|
11
|
+
|
12
|
+
# INDEX
|
13
|
+
def index
|
14
|
+
@snippet_urls = snippet_post.urls.all
|
15
|
+
end
|
16
|
+
|
17
|
+
# SHOW
|
18
|
+
def show
|
19
|
+
@snippet_url = snippet_post.urls.find(params[:id])
|
20
|
+
end
|
21
|
+
|
22
|
+
# NEW
|
23
|
+
def new
|
24
|
+
@snippet_url = snippet_post.urls.build
|
25
|
+
end
|
26
|
+
|
27
|
+
# EDIT
|
28
|
+
def edit
|
29
|
+
end
|
30
|
+
|
31
|
+
# CREATE
|
32
|
+
def create
|
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
|
+
else
|
39
|
+
render :new
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# UPDATE
|
44
|
+
def update
|
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
|
+
else
|
49
|
+
render :edit
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# DELETE
|
54
|
+
def destroy
|
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
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
# Common Callbacks
|
63
|
+
def set_snippet_url
|
64
|
+
@snippet_url = Snippet::Url.find(params[:id])
|
65
|
+
end
|
66
|
+
|
67
|
+
def snippet_post
|
68
|
+
@snippet_post = Snippet::Post.friendly.find(params[:post_id])
|
69
|
+
end
|
70
|
+
|
71
|
+
# Whitelist
|
72
|
+
def snippet_url_params
|
73
|
+
params.require(:snippet_url).permit(:snippet_post_url, :post_id, :slug, :user_id, :org_id)
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module ApplicationHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module ApplicationHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Script::AuthorsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Script::AuthorsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module PhcdevworksScripts
|
2
|
-
module Script::ExtensionsHelper
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module PhcdevworksScripts
|
2
|
+
module Script::ExtensionsHelper
|
3
|
+
end
|
4
|
+
end
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|