find_with_order 1.1.0 → 1.1.1

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: 4b55d8a4b8781f20d1a7d637f7d0c1ff0a71f802
4
- data.tar.gz: 95b37ac957f5fce50237e4869ce4702aa3a524a2
3
+ metadata.gz: d955f79fc86d2b1d9ddd2e4b0e5576fb2d89d252
4
+ data.tar.gz: d0eb726b23436e935c67065ec57ba4423fac9657
5
5
  SHA512:
6
- metadata.gz: e4bfb50a7c782f329b8834ac21cac0dfe78e4dd7b3d027c7d0ac479f27cde0e51c2cbbec240a8f8b2cb72e7e49d421ea47e1992a4debf77f7896e0ebdfe5546c
7
- data.tar.gz: 8a02ff25f68581747bd2a641ae147e900fe9e26e6d95269a02e1e7504caf04644d260e986cce0d2904a41af79787ac2c0c3025f686f378f08cbaa39cadab7ff4
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.030000 0.000000 0.030000 ( 0.033517)
52
- Find then sort by index 1.510000 0.030000 1.540000 ( 1.706246)
53
- Find then sort by hash mapping 1.120000 0.010000 1.130000 ( 1.192891)
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.
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "mysql2", ">= 0.3"
34
34
  spec.add_development_dependency "pg", "~> 0.18"
35
35
 
36
- spec.add_dependency "rails", ">= 3"
36
+ spec.add_dependency "activerecord", ">= 3"
37
37
 
38
38
  end
@@ -1,3 +1,3 @@
1
1
  module FindWithOrder
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
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.0
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-03-22 00:00:00.000000000 Z
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: rails
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.4.8
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.