rails-add_ons 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
  SHA1:
3
- metadata.gz: dabbd8a63d9974add6f3eb7a977852565273e302
4
- data.tar.gz: 2cec9a303127acf1bd21db8fb67c3be9b28a65ba
3
+ metadata.gz: 3db1c2410a1e776a8d8678c5a6d1088d24603da0
4
+ data.tar.gz: 2a864f0367a54fee3f7db6d3d4b406d58ea09986
5
5
  SHA512:
6
- metadata.gz: 755c1684e59fce44d3ec8beff99fbf8699e9c44ba75e1827e43cf646ff952c23422dbdd60b0f0fc80dc4f7044dfb7df98aba1d79bc99fcd69969a755e27c2184
7
- data.tar.gz: ef4fa636b37c73f4c1a48b8b608277e7c7cf0199d72ebb70cecf0765b9bc145240087421fb2115b6990479438e4bf0638867f5c9bddb882a8bd5d51e7b4600d2
6
+ metadata.gz: 8b123f820904f730d11c0e25bef48dc37374726b9dd70e5c238e7bb29fc93812e78e62bbe5f99a3e163326bf66342d6c62b7ec68a9d333751f9d8b8882be01eb
7
+ data.tar.gz: fd2501a293c35b191add5e2a08f82545f66ff84fbed6d0186fa60263023d6c95a93a4ae076fc7ca60548014d1d8dd9136ef48ca2deccf27240cd1ed38550c560
@@ -26,6 +26,11 @@ module ResourcesController::LocationHistory
26
26
 
27
27
  def truncate_location_history(count = 0)
28
28
  return if location_history.size <= count
29
- session[:location_history] = session[:location_history].sort.last(count).to_h
29
+ truncated = session[:location_history].sort.last(count)
30
+ session[:location_history] = if truncated.respond_to?(:to_h)
31
+ truncated.to_h
32
+ else
33
+ truncated.each_with_object({}) { |a, hash| hash[a.first] = a.last }
34
+ end
30
35
  end
31
36
  end
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module AddOns
3
- VERSION = '2.0.1'.freeze
3
+ VERSION = '2.0.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-add_ons
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
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-21 00:00:00.000000000 Z
11
+ date: 2018-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails