liquid-nested-sort 0.1.4 → 0.1.5

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: cd8e6dd55f926e5882ecf2f6295fd6367d95859b041b421d0593d4e9557f2704
4
- data.tar.gz: 0f783e368429c7181c78598526c66c772d0049acf3f3ce5d9d173e16a8ff9177
3
+ metadata.gz: f960256f408a36cc9c3f5f0f1be3296aa3a919734716a3d1f25bb043e6a5c443
4
+ data.tar.gz: a1a35ae637123dd1925a5407d02f151054cdb672d42dae2fa5b1749b9579ae6a
5
5
  SHA512:
6
- metadata.gz: 13ab19bc358dc67ce972058c84e0025274481bb0f57077abd3698995d3f827cf6541c370b9f269a248bc3dcbab8f11e3f06cbabb63d884c178cd2e4e072cd0dd
7
- data.tar.gz: e66875c8301c739721be3bef993a4811b639b8ef483cbb57b8b9bea4ee809799fc5ef2f4419b224c59f8ad2999b9c20a90845295cab1435d9097bf45e1815b3f
6
+ metadata.gz: a951ded949279e72f38cb86b07594cd7c50a09455e2994a1b688a0e3f720f06c45d3c23bad2767d30b03dfc6e93e96a160fc161770434ffdc683c9f613232ee4
7
+ data.tar.gz: e57d65ed6c30ebb6103da33d93450a6d5014102849b852fb837e15b862453d946e3c328039e61efba75a5a66e4669d885c9f022a40d970dc3ba6ffecd0c4c232
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- liquid-nested-sort (0.1.0)
4
+ liquid-nested-sort (0.1.4)
5
5
  liquid (>= 4.0, < 5.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Gem Version](https://img.shields.io/gem/v/liquid-nested-sort.svg)](https://rubygems.org/gems/liquid-nested-sort)
4
4
 
5
5
  `nested_sort` and `nested_sort_natural`, sort and sort_natural-like filters
6
- with nested fields support for Liquid.
6
+ with nested fields support for [Liquid](https://shopify.github.io/liquid/).
7
7
 
8
8
  ## Installation
9
9
 
@@ -76,6 +76,10 @@ module NestedFilters
76
76
  ary.sort do |a, b|
77
77
  LiquidUtils.nil_safe_compare(a, b)
78
78
  end
79
+ elsif property.include?('.') && LiquidUtils.nested_respond_to?(ary.first, property)
80
+ ary.sort do |a, b|
81
+ LiquidUtils.nil_safe_compare(LiquidUtils.nested_send(a, property), LiquidUtils.nested_send(b, property))
82
+ end
79
83
  elsif ary.all? { |el| el.respond_to?(:[]) }
80
84
  begin
81
85
  ary.sort { |a, b| LiquidUtils.nil_safe_compare(a[property], b[property]) }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'liquid-nested-sort'
5
- s.version = '0.1.4'
5
+ s.version = '0.1.5'
6
6
  s.date = '2020-09-03'
7
7
 
8
8
  s.author = 'Fabio Bonelli'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid-nested-sort
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Bonelli