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 +4 -4
- data/CHANGELOG +3 -0
- data/README.md +1 -1
- data/lib/active_set.rb +4 -3
- data/lib/active_set/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6972c807b12c1eb191198aecdc0c08256953382
|
4
|
+
data.tar.gz: 8c9c412d18da350ebdae78a46f006ebad98764e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
|
data/lib/active_set.rb
CHANGED
@@ -37,7 +37,8 @@ class ActiveSet
|
|
37
37
|
|
38
38
|
def filter(instructions)
|
39
39
|
filterer = FilterProcessor.new(@set, instructions)
|
40
|
-
|
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
|
data/lib/active_set/version.rb
CHANGED
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.
|
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
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|