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 +4 -4
- data/app/controllers/short_rails/short_urls_controller.rb +11 -1
- data/lib/short_rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b300c630b3179712d6bfed4c05e4f7c9d82ba9aaa6c9cc6c407195fa2c3b48ee
|
4
|
+
data.tar.gz: 5ffcc9e96a686efd5e2c9b937cc4bd1664081762b04620791b16a0bd41acea8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/short_rails/version.rb
CHANGED
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.
|
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-
|
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.
|
93
|
+
rubygems_version: 3.3.16
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: URL shortener
|