phccodesnipperpro 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c3fd4994895d753c4fdab9e638b72c0a8141e078b8650be042468e06cfae99e
4
- data.tar.gz: 02bc81e8f8871c2c748ed25f22b93e47dc6fa43b9653a9c0a3c16300ef405a35
3
+ metadata.gz: 2b9c9864adc927dd1c26147a98eae5b3e5fb8abff070c07fd528f7ef21d6a9ba
4
+ data.tar.gz: c6de6c8cac00d6c9054756003453050250aaa63f62c5c483047467de063f6fde
5
5
  SHA512:
6
- metadata.gz: 97abc474d7bea9c0d94f476dc6db2307c0f36f7b3f7ee13c38efe04109c0b8178234bcc26b647f194223b3e39fd60243f92fe7ce0b86045b2dbd89dc58cbef46
7
- data.tar.gz: 92463c76a8abc93496797bce7d6d7a6e7715e97ce2f42c27bd8635e90a00794b8f5a586aa583f935b9410a097d5a9aadcf4713eb2a82c51ea47483bbd0124ee4
6
+ metadata.gz: 4b1aae531099746c9def7a72fd056ad562b5e83e0179f970ea4e2b7f8c31d68c1d6d46292b912c353b1ff98a0be975df6f9407528699d8f5290046793d4b41de
7
+ data.tar.gz: 79df1125613f412c3b06bf374e9731cbb8f8e43b79659332773f1d4fd7cb25fe5a94444af74941cca8e4c7ec8b03cb2db011c000a6c6ec3b3b36887509d1de0a
@@ -10,7 +10,7 @@ module Phccodesnipperpro
10
10
 
11
11
  # INDEX
12
12
  def index
13
- @script_snippets = Script::Snippet.all
13
+ @script_snippets = Script::Snippet.where(org_id: current_user.org_id)
14
14
  end
15
15
 
16
16
  # SHOW
@@ -29,8 +29,10 @@ module Phccodesnipperpro
29
29
  # CREATE
30
30
  def create
31
31
  @script_snippet = Script::Snippet.new(script_snippet_params)
32
+ @script_snippet.user_id = current_user.id
33
+ @script_snippet.org_id = current_user.org_id
32
34
  if @script_snippet.save
33
- redirect_to @script_snippet, :flash => { :success => 'Snippet was successfully created.' }
35
+ redirect_to @script_snippet, :flash => { :success => 'Snippet was Successfully Created.' }
34
36
  else
35
37
  render :new
36
38
  end
@@ -39,7 +41,7 @@ module Phccodesnipperpro
39
41
  # UPDATE
40
42
  def update
41
43
  if @script_snippet.update(script_snippet_params)
42
- redirect_to @script_snippet, :flash => { :success => 'Snippet was successfully updated.' }
44
+ redirect_to @script_snippet, :flash => { :success => 'Snippet was Successfully Updated.' }
43
45
  else
44
46
  render :edit
45
47
  end
@@ -48,7 +50,7 @@ module Phccodesnipperpro
48
50
  # DELETE
49
51
  def destroy
50
52
  @script_snippet.destroy
51
- redirect_to script_snippets_url, :flash => { :error => 'Snippet was successfully destroyed.' }
53
+ redirect_to script_snippets_url, :flash => { :error => 'Snippet was Successfully Removed.' }
52
54
  end
53
55
 
54
56
  private
@@ -11,7 +11,7 @@ module Phccodesnipperpro
11
11
  # INDEX
12
12
  def index
13
13
  snippet = Script::Snippet.find(params[:snippet_id])
14
- @script_urls = snippet.urls.all
14
+ @script_urls = snippet.urls.where(org_id: current_user.org_id)
15
15
  end
16
16
 
17
17
  # SHOW
@@ -35,8 +35,9 @@ module Phccodesnipperpro
35
35
  @script_snippet = Script::Snippet.find(params[:snippet_id])
36
36
  @script_url = @script_snippet.urls.create(script_url_params)
37
37
  @script_url.user_id = current_user.id
38
+ @script_url.org_id = current_user.org_id
38
39
  if @script_url.save
39
- redirect_to script_snippet_urls_path, :flash => { :success => 'Script url was successfully created.' }
40
+ redirect_to script_snippet_urls_path, :flash => { :success => 'Snippet URL was Successfully Created.' }
40
41
  else
41
42
  render :new
42
43
  end
@@ -46,7 +47,7 @@ module Phccodesnipperpro
46
47
  def update
47
48
  @script_snippet = Script::Snippet.find(params[:snippet_id])
48
49
  if @script_url.update(script_url_params)
49
- redirect_to script_snippet_urls_path, :flash => { :success => 'Script url was successfully updated.' }
50
+ redirect_to script_snippet_urls_path, :flash => { :success => 'Snippet URL was Successfully Updated.' }
50
51
  else
51
52
  render :edit
52
53
  end
@@ -57,7 +58,7 @@ module Phccodesnipperpro
57
58
  @script_snippet = Script::Snippet.find(params[:snippet_id])
58
59
  @script_url = @script_snippet.urls.find(params[:id])
59
60
  @script_url.destroy
60
- redirect_to script_snippet_urls_path, :flash => { :error => 'Script url was successfully destroyed.' }
61
+ redirect_to script_snippet_urls_path, :flash => { :error => 'Snippet URL was Successfully Removed.' }
61
62
  end
62
63
 
63
64
  private
@@ -1,7 +1,7 @@
1
1
  <!-- Footer -->
2
2
  <span class="float-left">
3
3
  2012-<%= Time.now.year %> -
4
- <strong>PHC</strong>CodeSnipper -
4
+ <strong>PHC</strong>CodeSnipper(Pro) -
5
5
  Engine v<%= Gem.loaded_specs["phccodesnipperpro"].version.to_s %>
6
6
  </span>
7
7
  <span class="float-right">
@@ -1,7 +1,7 @@
1
1
  <!-- Topbar - Navigation Header -->
2
2
  <div class="navbar-header">
3
3
  <%= link_to phccodesnipperpro.script_snippets_path, class: "navbar-brand" do %>
4
- <strong>PHC</strong>CodeSnipper
4
+ <strong>PHC</strong>CodeSnipper(Pro)
5
5
  <% end %>
6
6
  <button type="button" class="navbar-toggle" data-click="sidebar-toggled">
7
7
  <span class="icon-bar"></span>
@@ -1,3 +1,3 @@
1
1
  module Phccodesnipperpro
2
- VERSION = '1.0.0'
2
+ VERSION = '2.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phccodesnipperpro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.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: 2019-05-18 00:00:00.000000000 Z
11
+ date: 2019-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails