actionset 0.3.4 → 0.3.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 +4 -4
- data/CHANGELOG +3 -0
- data/lib/action_set.rb +4 -5
- data/lib/action_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: bcf22ea0b6bf2bc8736afb56c36e8223d1aa70df
|
4
|
+
data.tar.gz: 56fec8d7cc74be2aaa9a5b54504b16fadb78a154
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe390e2de9dcaec0cc4f0d9b293acc70cb6019c56362a14ba1062947ed04fa32562e9adaa3eff6e2f7a670ce7086b7c411214e9cb388f8527365eba726e25791
|
7
|
+
data.tar.gz: e81f275a7a8f82efad37b7c9ac741523f8fca6e0d8b8f8ab5b0b63e7d4a171d0f24332ea169386658e18bce83e360d1ba5e7101b1e03a40516c167dce4c784a2
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
v 0.3.5
|
2
|
+
- Don't rely on an instance variable for the `filter_structure`
|
3
|
+
- Use the `ensure_active_set` method inside of `process_set`
|
1
4
|
v 0.3.4
|
2
5
|
- Ensure that the sort_link_for helper method make the title param optional
|
3
6
|
- Ensure that the view helpers are properly included into the ActionView context
|
data/lib/action_set.rb
CHANGED
@@ -27,14 +27,13 @@ module ActionSet
|
|
27
27
|
|
28
28
|
module InstanceMethods
|
29
29
|
def process_set(set)
|
30
|
-
|
31
|
-
paginate_set(sort_set(filter_set(ActiveSet.new(set))))
|
30
|
+
paginate_set(sort_set(filter_set(ensure_active_set(set))))
|
32
31
|
end
|
33
32
|
|
34
33
|
def filter_set(set)
|
35
34
|
set_filters_ivar
|
36
35
|
active_set = ensure_active_set(set)
|
37
|
-
active_set = active_set.filter(filter_structure) if filter_params.any?
|
36
|
+
active_set = active_set.filter(filter_structure(set)) if filter_params.any?
|
38
37
|
active_set
|
39
38
|
end
|
40
39
|
|
@@ -64,10 +63,10 @@ module ActionSet
|
|
64
63
|
|
65
64
|
private
|
66
65
|
|
67
|
-
def filter_structure
|
66
|
+
def filter_structure(set)
|
68
67
|
filter_params.flatten_keys.reject { |_, v| v.blank? }.each_with_object({}) do |(keypath, value), memo|
|
69
68
|
instruction = ActiveSet::Instructions::Entry.new(keypath, value)
|
70
|
-
item_with_value =
|
69
|
+
item_with_value = set.find { |i| !instruction.value_for(item: i).nil? }
|
71
70
|
item_value = instruction.value_for(item: item_with_value)
|
72
71
|
typecast_value = ActionSet::Instructions::EntryValue.new(value)
|
73
72
|
.cast(to: item_value.class)
|
data/lib/action_set/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Margheim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeset
|