rao-service_controller 0.0.50.pre → 0.0.51.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e41c9b1dd55204c17387391a61aebc67c2e4a85d71c4f96e5e905e06a66ac674
|
4
|
+
data.tar.gz: fa08b4311d2f993e2f788a8bb6a759e59ea39d7814f274fbf92593e8fb122d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda55b0511e2c4a3bec09420f749e9edea28e8e116c4f6fec018f6d927b338b38a3b2aab4b7778a80c2fa5058bdee653f3b712d5fccbc0e9e6453e01d5449305
|
7
|
+
data.tar.gz: 9678e9704c74990ac2c4617ab28d203c2cdd17e12e1e773c27a251bdb0465a77737813dd5e553a511f41b84c77d54ba1c76c597082d467c2f4ca470e22b1f57d
|
@@ -8,12 +8,16 @@ module Rao
|
|
8
8
|
else
|
9
9
|
before_filter :store_location
|
10
10
|
end
|
11
|
+
|
12
|
+
helper_method :last_location
|
11
13
|
end
|
12
14
|
|
13
15
|
private
|
14
16
|
|
15
17
|
def store_location
|
16
|
-
|
18
|
+
return if request.referer.nil?
|
19
|
+
truncate_location_history(3)
|
20
|
+
puts "[LocationHistoryConcern] Storing last location [#{request.referer}]"
|
17
21
|
location_history[Time.zone.now] = request.referer
|
18
22
|
end
|
19
23
|
|
@@ -27,7 +31,12 @@ module Rao
|
|
27
31
|
|
28
32
|
def truncate_location_history(count = 0)
|
29
33
|
return if location_history.size <= count
|
30
|
-
|
34
|
+
truncated = session[:location_history].sort.last(count)
|
35
|
+
session[:location_history] = if truncated.respond_to?(:to_h)
|
36
|
+
truncated.to_h
|
37
|
+
else
|
38
|
+
truncated.each_with_object({}) { |a, hash| hash[a.first] = a.last }
|
39
|
+
end
|
31
40
|
end
|
32
41
|
end
|
33
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rao-service_controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.51.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
- !ruby/object:Gem::Version
|
197
197
|
version: 1.3.1
|
198
198
|
requirements: []
|
199
|
-
rubygems_version: 3.4.
|
199
|
+
rubygems_version: 3.4.21
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: Services Controller for Ruby on Rails.
|