short_rails 2.0.1 → 2.0.2

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: ca33b7c60de0f51c85c943bb53b00da0bd60a9e6d25540c129a9af2f74b3ed34
4
- data.tar.gz: b8de5a9552fe3236b9a527dc6559f96f5ebfb111bcef99a27faf2db25d5974b8
3
+ metadata.gz: b300c630b3179712d6bfed4c05e4f7c9d82ba9aaa6c9cc6c407195fa2c3b48ee
4
+ data.tar.gz: 5ffcc9e96a686efd5e2c9b937cc4bd1664081762b04620791b16a0bd41acea8f
5
5
  SHA512:
6
- metadata.gz: 655b5878c74abed2304d498c81deafb4ddb227a2159486af2a0c9a06e3397f555b0d5b6c7912bb3a7eafa43a09ddf3e896f4d067fc6bac441e605c9caffa5053
7
- data.tar.gz: 881786572239f4c330f7e76723d25acf0d0668ba2d061e1d7620392c840619ddae039fb3a39abdd337c10c295502259ad5444fa81781d168c43ff784dfeee536
6
+ metadata.gz: 52138bb5f8c1b8fa9ffe16c496b4e4064076268e7193da9926dcf08c42f4ff8de307e542a2f83f993cccefa1198ed55507a3235d0dee1a00d6e7eb78bfc1a1f7
7
+ data.tar.gz: 8b35f5e2703d06be4fdddaf30a4c8fc744dc8b07700fcaa04f8836fde454e252b1a05c52befcd73257433d921e1d6d07afa49e8aa91aaf88a2067c456aec4a7e
@@ -11,6 +11,9 @@ module ShortRails
11
11
  return
12
12
  end
13
13
 
14
+ # update updated_at timestamp
15
+ short_url.touch
16
+
14
17
  if short_url.url_short_param.nil?
15
18
  # redirect to full URL
16
19
  query_params = short_url.params
@@ -48,6 +51,9 @@ module ShortRails
48
51
  return
49
52
  end
50
53
 
54
+ # update updated_at timestamp
55
+ short_url.touch
56
+
51
57
  render json: short_url.params
52
58
  end
53
59
 
@@ -56,7 +62,8 @@ module ShortRails
56
62
  def qrcode
57
63
  require 'rqrcode'
58
64
 
59
- if ShortUrl.find_by_short(params[:short]).nil?
65
+ short_url = ShortUrl.find_by_short(params[:short])
66
+ if short_url.nil?
60
67
  render plain: "ERROR: Could not generate QR code", status: :not_found
61
68
  return
62
69
  end
@@ -120,6 +127,9 @@ module ShortRails
120
127
  end
121
128
  end
122
129
 
130
+ # update updated_at timestamp
131
+ short_url.touch
132
+
123
133
  send_data qr_image.to_s, type: 'image/png', disposition: 'inline', filename: "#{params[:short]}.png"
124
134
  end
125
135
  end
@@ -1,3 +1,3 @@
1
1
  module ShortRails
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: short_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Walker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-04-26 00:00:00.000000000 Z
12
+ date: 2022-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 3.1.6
93
+ rubygems_version: 3.3.16
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: URL shortener