activeset 0.5.3 → 0.5.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d5e68a1195e14dbb27b6e12c2be3fcbb3438dfd
|
4
|
+
data.tar.gz: 41147254b36a900c9bbdf85bf5b1f64345cd0d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ee3ed0cca9255e022e57548649f2464b1b08a29877e96b2e0187298b04c347b2caf3ea42739a3bffab34af6ac9081bed494feb875c7b9c583038f5ad69752a7
|
7
|
+
data.tar.gz: c2e67201fb0e76b5f2bd995bcbc6038c1948a27f5efdbeccb9f19b5eea0b4ae901d75f878265a9925daa3e3c4e5989d1a8fe2e5f59bff6853694080c3caa1169
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
v 0.5.4
|
2
|
+
- Ensure that Instructions wrap a Hash with indifferent access
|
3
|
+
- Wire up both adapters for the PaginateProcessor
|
4
|
+
- Fix bug where ActiveRecord Paginator didn’t offset pages correctly
|
1
5
|
v 0.5.3
|
2
6
|
- Extract logic for creating new ActiveSet instance after an operation into separate method
|
3
7
|
- Ensure that the instructions logged for the paginate operation handle defaults
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support/core_ext/hash/keys'
|
4
|
+
require 'active_support/core_ext/hash/indifferent_access'
|
4
5
|
|
5
6
|
require_relative './entry'
|
6
7
|
|
@@ -9,7 +10,7 @@ class ActiveSet
|
|
9
10
|
attr_reader :hash
|
10
11
|
|
11
12
|
def initialize(hash)
|
12
|
-
@hash = hash
|
13
|
+
@hash = hash.with_indifferent_access
|
13
14
|
@flattened_hash = hash.flatten_keys.transform_keys { |k| k.map(&:to_s) }
|
14
15
|
end
|
15
16
|
|
@@ -6,17 +6,21 @@ require_relative './paginate/active_record_adapter'
|
|
6
6
|
|
7
7
|
class ActiveSet
|
8
8
|
class PaginateProcessor < BaseProcessor
|
9
|
+
queue_adapter ActiveRecordAdapter
|
10
|
+
queue_adapter EnumerableAdapter
|
11
|
+
|
9
12
|
def process
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
+
adapters.each do |adapter|
|
14
|
+
output = adapter.new(@set, instruction).process
|
13
15
|
|
14
|
-
|
16
|
+
return output[:set] if output[:processed]
|
17
|
+
end
|
15
18
|
|
16
|
-
|
17
|
-
EnumerableAdapter
|
19
|
+
@set
|
18
20
|
end
|
19
21
|
|
22
|
+
private
|
23
|
+
|
20
24
|
def instruction
|
21
25
|
Instructions::Entry.new(page_number, page_size)
|
22
26
|
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.4
|
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-10-
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|