activeset 0.5.6 → 0.5.7

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: ff640ddf5701dcd0135532270123f046975c707c
4
- data.tar.gz: 16b6fd9a4b307db53c4bccd6195062550451c325
3
+ metadata.gz: d6972c807b12c1eb191198aecdc0c08256953382
4
+ data.tar.gz: 8c9c412d18da350ebdae78a46f006ebad98764e8
5
5
  SHA512:
6
- metadata.gz: c98f1ecd55d438fb238fe9b6595d8a661c13c9d5a8118505f04b8868a7e5768aeef87d166fb14399cae41b6d3cd63d85f26de70f1e9e3d6cc94509782e78a1ad
7
- data.tar.gz: d02ef5fa2c2c09039da54f79f10c43fd34d82f66fa50c2a4a36846e1bc730266a92ed9041e2d7cec5d89afcc5a5701027a5eaf141a92b6c74d248330ff108184
6
+ metadata.gz: 47ad1ecf1991b76272e234476c62832c5b15cf6011a21d44ecbb77718a40f5ac7524dad1cc0344daf3fad0ee076d990d123106cf52557d4985318ea3d89c2f4e
7
+ data.tar.gz: 40aacf00dbe68267c227d7b3712ffa5433abd9db89197610cde7fc8ffeb711cedb829fee9c497d4794b4629f0aedc3d046155698dfbf5ecca33ff94f3b9d8dd8
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v 0.5.7
2
+ - Fix bug where filtering wasn't updating the new ActiveSet instances #total_count
3
+ - Add that this gem now does transformations to the README
1
4
  v 0.5.6
2
5
  - Ensure that the default value for instructions when building filtering queries is '=' and not '=='
3
6
  - Allow the default value for the instructions keypath's operator to be passed in
data/README.md CHANGED
@@ -18,7 +18,7 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- The `ActiveSet` class is an extension of `Enumerable` that adds methods for filtering, sorting, and paginating (right now; other methods are sure to follow).
21
+ The `ActiveSet` class is an extension of `Enumerable` that adds methods for filtering, sorting, paginating, and transforming (right now; other methods are sure to follow).
22
22
 
23
23
  Every convenience method added to the `ActiveSet` class is handled via a `Processor` class, and that `Processor` class will then use 1 or more `Adapter` classes to actually fulfill the functional contract.
24
24
 
@@ -37,7 +37,8 @@ class ActiveSet
37
37
 
38
38
  def filter(instructions)
39
39
  filterer = FilterProcessor.new(@set, instructions)
40
- new_active_set(filterer.process, :filter, instructions)
40
+ filtered_set = filterer.process
41
+ new_active_set(filtered_set, :filter, instructions, filtered_set.count)
41
42
  end
42
43
 
43
44
  def sort(instructions)
@@ -59,9 +60,9 @@ class ActiveSet
59
60
 
60
61
  private
61
62
 
62
- def new_active_set(set, method, instructions)
63
+ def new_active_set(set, method, instructions, total_count = nil)
63
64
  self.class.new(set,
64
65
  instructions: @instructions.merge(method => instructions),
65
- total_count: @total_count)
66
+ total_count: total_count || @total_count)
66
67
  end
67
68
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ActiveSet
4
- VERSION = '0.5.6'
4
+ VERSION = '0.5.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Margheim
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2017-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport