find_with_order 1.1.0 → 1.1.1
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/README.md +13 -3
- data/find_with_order.gemspec +1 -1
- data/lib/find_with_order/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d955f79fc86d2b1d9ddd2e4b0e5576fb2d89d252
|
4
|
+
data.tar.gz: d0eb726b23436e935c67065ec57ba4423fac9657
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8abb85b303feae5550fafad62a2db381c16350829427f4ce46da796e3a15fcc0e28fa2cf25b3b168407ebe81cb98280fab6a584dc91ebe4214ed4bad6cab949a
|
7
|
+
data.tar.gz: 33ad5f2bd2f4957828d02072ca4c4feca2b35c39d8c85021e3820cc8fb9882a540f5ee306d74c392ead5fca7ce954886355af12ebacd2a20d0813d2efde39e04
|
data/README.md
CHANGED
@@ -45,15 +45,25 @@ User.where_with_order(:name, %w(Pearl John Kathenrie)).pluck(:name)
|
|
45
45
|
```
|
46
46
|
|
47
47
|
## Benchmark
|
48
|
+
### Compare with manually sorting in rails
|
48
49
|
|
49
50
|
```
|
50
51
|
user system total real
|
51
|
-
Find with order 0.
|
52
|
-
Find then sort by index
|
53
|
-
Find then sort by hash mapping 1.
|
52
|
+
Find with order 0.050000 0.010000 0.060000 ( 0.074975)
|
53
|
+
Find then sort by index 2.520000 0.120000 2.640000 ( 3.238615)
|
54
|
+
Find then sort by hash mapping 1.410000 0.070000 1.480000 ( 1.737176)
|
54
55
|
```
|
55
56
|
[test script](https://github.com/khiav223577/find_with_order/issues/4)
|
56
57
|
|
58
|
+
### Compare with order_as_specified
|
59
|
+
```
|
60
|
+
user system total real
|
61
|
+
order_as_specified 0.020000 0.000000 0.020000 ( 0.703773)
|
62
|
+
where_with_order 0.020000 0.000000 0.020000 ( 0.031723)
|
63
|
+
```
|
64
|
+
[test script](https://github.com/khiav223577/find_with_order/issues/4#issuecomment-307376453)
|
65
|
+
|
66
|
+
|
57
67
|
## Development
|
58
68
|
|
59
69
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test DB=mysql` / `rake test DB=pg` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/find_with_order.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: find_with_order
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khiav reoy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.18'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: activerecord
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.6.8
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: A simple way to find records in the same order of input array.
|