action_interceptor 1.0.0 → 1.1.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9407178e3d4a8be9957a5eacd4df9ee9f0866dc6
|
4
|
+
data.tar.gz: da347d252ab6462a8c29ffdc3c50ba9628fc672a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eb6db687c0d53268e0abc9d7e4199291373297c51b70edbe10f54c9bfdab651749f6f3c672bd44a88cf73bc301f10349a5d8f5dcc3270c162e1cc80fb724a75
|
7
|
+
data.tar.gz: d8058e0e5039eb228e1165cd7ada869fd0442673ab690a36e5d728e45633d110907a93ad31d25c4e4c1e8b93282e8d2fc9111cb2b8468cae7d7802bf7935b963
|
@@ -25,24 +25,22 @@ module ActionInterceptor
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# Stores the given url or the current url
|
28
|
+
# If the current request is not a GET request, stores the referer instead
|
28
29
|
def store_url(options = {})
|
29
|
-
strats = ActionInterceptor::Strategies.find_all(self,
|
30
|
-
options[:strategies])
|
30
|
+
strats = ActionInterceptor::Strategies.find_all(self, options[:strategies])
|
31
31
|
key = options[:key] || ActionInterceptor.config.default_key
|
32
32
|
|
33
|
-
url = options.has_key?(:url) ?
|
33
|
+
url = options.has_key?(:url) ?
|
34
|
+
options[:url] : (request.get? ? current_url : request.referer)
|
34
35
|
|
35
|
-
strats.each
|
36
|
-
strat.set(key, url)
|
37
|
-
end
|
36
|
+
strats.each{ |strat| strat.set(key, url) }
|
38
37
|
|
39
38
|
url
|
40
39
|
end
|
41
40
|
|
42
41
|
# Retrieves the stored url
|
43
42
|
def stored_url(options = {})
|
44
|
-
strats = ActionInterceptor::Strategies.find_all(self,
|
45
|
-
options[:strategies])
|
43
|
+
strats = ActionInterceptor::Strategies.find_all(self, options[:strategies])
|
46
44
|
key = options[:key] || ActionInterceptor.config.default_key
|
47
45
|
|
48
46
|
strats.each do |strat|
|
@@ -61,8 +59,7 @@ module ActionInterceptor
|
|
61
59
|
|
62
60
|
# Deletes to the stored url
|
63
61
|
def delete_stored_url(options = {})
|
64
|
-
strats = ActionInterceptor::Strategies.find_all(self,
|
65
|
-
options[:strategies])
|
62
|
+
strats = ActionInterceptor::Strategies.find_all(self, options[:strategies])
|
66
63
|
key = options[:key] || ActionInterceptor.config.default_key
|
67
64
|
|
68
65
|
strats.each do |strat|
|
@@ -81,8 +78,7 @@ module ActionInterceptor
|
|
81
78
|
delete_stored_url(interceptor_options)
|
82
79
|
|
83
80
|
# Prevent self redirects
|
84
|
-
url = (ActionInterceptor.config.default_url || main_app.root_url)
|
85
|
-
if current_page?(url)
|
81
|
+
url = (ActionInterceptor.config.default_url || main_app.root_url) if current_page?(url)
|
86
82
|
|
87
83
|
redirect_to url, redirect_options
|
88
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_interceptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dante Soares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.4.
|
138
|
+
rubygems_version: 2.4.5.1
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Handles storage of return url's across multiple requests
|