effective_resources 2.19.8 → 2.19.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a64aa8daa41dc12a1702ee128d8a972ec46a005f616f2091f9821075c817f9c7
|
4
|
+
data.tar.gz: c59a857b8b39855a74bfda837b59c259d92b192081c9af65947ad22de202d074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71b49bf9d7152eeee999e1fffec4020355274f140c6c6e3bc4757cc8c69716808816bff5bf96b8332028ddedbf8ef24633616ea827118154bd7935aa0804a83a
|
7
|
+
data.tar.gz: 1ff8ec49ce929e048e9582134447046c03448c7d0a2d0fb794c6024e83a03d705a9193a63336bd6fd7d4b0e64f1e08e44ceb2f54de281c175f3de0cb344170ac
|
@@ -72,10 +72,22 @@ module Effective
|
|
72
72
|
def referer_redirect_path
|
73
73
|
url = request.referer.to_s
|
74
74
|
|
75
|
-
|
75
|
+
# Referer may not always be present
|
76
|
+
return if url.blank?
|
77
|
+
|
78
|
+
# Don't redirect back to this resource's show or edit page
|
79
|
+
if resource.try(:destroyed?)
|
80
|
+
to_param = (resource.to_param || resource.try(:token) || resource.try(:slug) || resource.id) # to_param is nil sometimes
|
81
|
+
return if to_param.present? && url.include?("/#{to_param}")
|
82
|
+
end
|
83
|
+
|
84
|
+
# Don't redirect back if we're on duplicate action
|
76
85
|
return if url.include?('duplicate_id=')
|
77
|
-
return unless (Rails.application.routes.recognize_path(URI(url).path) rescue false)
|
78
86
|
|
87
|
+
# Don't redirect unless we recognize the url
|
88
|
+
return unless (Rails.application.routes.recognize_path(url) rescue false) || (Rails.application.routes.recognize_path(URI(url).path) rescue false)
|
89
|
+
|
90
|
+
# Redirect to this recognized url
|
79
91
|
url
|
80
92
|
end
|
81
93
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.19.
|
4
|
+
version: 2.19.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
rubygems_version: 3.
|
291
|
+
rubygems_version: 3.5.6
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Make any controller an effective resource controller.
|