pluck_all 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 +4 -4
- data/.travis.yml +7 -0
- data/README.md +6 -3
- data/bin/setup +1 -1
- data/gemfiles/3.2.gemfile +6 -0
- data/gemfiles/4.2.gemfile +6 -0
- data/gemfiles/4.2.gemfile.lock +127 -0
- data/gemfiles/5.0.gemfile +6 -0
- data/lib/pluck_all/version.rb +1 -1
- data/pluck_all.gemspec +2 -2
- metadata +24 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 485e0ca4ce63f16b9832772663ea5c383eb838de
|
4
|
+
data.tar.gz: 66df601d24c04c6f3f1744dbaa96fd51b1fa9964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37d6fc731ab8bf01b6090a95ef92e1d9514ba7e03ddfe74f713bbb22aded239702b8228367483898aa12556d8bef30dc680e34b64dd131740e23199964f6fd1e
|
7
|
+
data.tar.gz: 8f0f4b77ab635b9d7d8c2bf4ac1d94208ff9cfc37ea9df7ae447b41665c61f76760fee4c98cc36b0438e43e089ab9697f0a1f54c7cddbb75b388452968419270
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
-
[![Gem Version](https://
|
1
|
+
[![Gem Version](https://img.shields.io/gem/v/pluck_all.svg?style=flat)](http://rubygems.org/gems/pluck_all)
|
2
2
|
[![Build Status](https://travis-ci.org/khiav223577/pluck_all.svg?branch=master)](https://travis-ci.org/khiav223577/pluck_all)
|
3
|
+
[![RubyGems](http://img.shields.io/gem/dt/pluck_all.svg?style=flat)](http://rubygems.org/gems/pluck_all)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/khiav223577/pluck_all/badges/gpa.svg)](https://codeclimate.com/github/khiav223577/pluck_all)
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/khiav223577/pluck_all/badges/coverage.svg)](https://codeclimate.com/github/khiav223577/pluck_all/coverage)
|
3
6
|
|
4
7
|
# PluckAll
|
5
8
|
|
6
|
-
|
9
|
+
Pluck multiple attributes in Rails 3, 4, 5, and can return data as hash instead of only array.
|
7
10
|
|
8
11
|
This Gem standing on the shoulders of this [article](http://meltingice.net/2013/06/11/pluck-multiple-columns-rails/).
|
9
12
|
And modify it to support not only Rail 3.
|
@@ -37,7 +40,7 @@ User.where(:id => [1,2]).pluck_array(:id, :account)
|
|
37
40
|
# => [[1, 'account1'], [2, 'account2']]
|
38
41
|
```
|
39
42
|
### pluck to hash
|
40
|
-
Similar to pluck_array
|
43
|
+
Similar to `pluck_array`, but return hash instead.
|
41
44
|
```rb
|
42
45
|
User.where(:id => [1,2]).pluck_all(:id, :account)
|
43
46
|
# => [{"id"=>1, "account"=>"account1"}, {"id"=>2, "account"=>"account2"}]
|
data/bin/setup
CHANGED
data/gemfiles/3.2.gemfile
CHANGED
data/gemfiles/4.2.gemfile
CHANGED
@@ -0,0 +1,127 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
pluck_all (1.1.0)
|
5
|
+
rails (>= 3)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionmailer (4.2.7.1)
|
11
|
+
actionpack (= 4.2.7.1)
|
12
|
+
actionview (= 4.2.7.1)
|
13
|
+
activejob (= 4.2.7.1)
|
14
|
+
mail (~> 2.5, >= 2.5.4)
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
|
+
actionpack (4.2.7.1)
|
17
|
+
actionview (= 4.2.7.1)
|
18
|
+
activesupport (= 4.2.7.1)
|
19
|
+
rack (~> 1.6)
|
20
|
+
rack-test (~> 0.6.2)
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
23
|
+
actionview (4.2.7.1)
|
24
|
+
activesupport (= 4.2.7.1)
|
25
|
+
builder (~> 3.1)
|
26
|
+
erubis (~> 2.7.0)
|
27
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
29
|
+
activejob (4.2.7.1)
|
30
|
+
activesupport (= 4.2.7.1)
|
31
|
+
globalid (>= 0.3.0)
|
32
|
+
activemodel (4.2.7.1)
|
33
|
+
activesupport (= 4.2.7.1)
|
34
|
+
builder (~> 3.1)
|
35
|
+
activerecord (4.2.7.1)
|
36
|
+
activemodel (= 4.2.7.1)
|
37
|
+
activesupport (= 4.2.7.1)
|
38
|
+
arel (~> 6.0)
|
39
|
+
activesupport (4.2.7.1)
|
40
|
+
i18n (~> 0.7)
|
41
|
+
json (~> 1.7, >= 1.7.7)
|
42
|
+
minitest (~> 5.1)
|
43
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
44
|
+
tzinfo (~> 1.1)
|
45
|
+
arel (6.0.4)
|
46
|
+
builder (3.2.2)
|
47
|
+
codeclimate-test-reporter (1.0.3)
|
48
|
+
simplecov
|
49
|
+
concurrent-ruby (1.0.4)
|
50
|
+
docile (1.1.5)
|
51
|
+
erubis (2.7.0)
|
52
|
+
globalid (0.3.7)
|
53
|
+
activesupport (>= 4.1.0)
|
54
|
+
i18n (0.7.0)
|
55
|
+
json (1.8.3)
|
56
|
+
loofah (2.0.3)
|
57
|
+
nokogiri (>= 1.5.9)
|
58
|
+
mail (2.6.4)
|
59
|
+
mime-types (>= 1.16, < 4)
|
60
|
+
mime-types (3.1)
|
61
|
+
mime-types-data (~> 3.2015)
|
62
|
+
mime-types-data (3.2016.0521)
|
63
|
+
mini_portile2 (2.1.0)
|
64
|
+
minitest (5.10.1)
|
65
|
+
nokogiri (1.7.0)
|
66
|
+
mini_portile2 (~> 2.1.0)
|
67
|
+
rack (1.6.5)
|
68
|
+
rack-test (0.6.3)
|
69
|
+
rack (>= 1.0)
|
70
|
+
rails (4.2.7.1)
|
71
|
+
actionmailer (= 4.2.7.1)
|
72
|
+
actionpack (= 4.2.7.1)
|
73
|
+
actionview (= 4.2.7.1)
|
74
|
+
activejob (= 4.2.7.1)
|
75
|
+
activemodel (= 4.2.7.1)
|
76
|
+
activerecord (= 4.2.7.1)
|
77
|
+
activesupport (= 4.2.7.1)
|
78
|
+
bundler (>= 1.3.0, < 2.0)
|
79
|
+
railties (= 4.2.7.1)
|
80
|
+
sprockets-rails
|
81
|
+
rails-deprecated_sanitizer (1.0.3)
|
82
|
+
activesupport (>= 4.2.0.alpha)
|
83
|
+
rails-dom-testing (1.0.8)
|
84
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
85
|
+
nokogiri (~> 1.6)
|
86
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
87
|
+
rails-html-sanitizer (1.0.3)
|
88
|
+
loofah (~> 2.0)
|
89
|
+
railties (4.2.7.1)
|
90
|
+
actionpack (= 4.2.7.1)
|
91
|
+
activesupport (= 4.2.7.1)
|
92
|
+
rake (>= 0.8.7)
|
93
|
+
thor (>= 0.18.1, < 2.0)
|
94
|
+
rake (10.5.0)
|
95
|
+
simplecov (0.12.0)
|
96
|
+
docile (~> 1.1.0)
|
97
|
+
json (>= 1.8, < 3)
|
98
|
+
simplecov-html (~> 0.10.0)
|
99
|
+
simplecov-html (0.10.0)
|
100
|
+
sprockets (3.7.1)
|
101
|
+
concurrent-ruby (~> 1.0)
|
102
|
+
rack (> 1, < 3)
|
103
|
+
sprockets-rails (3.2.0)
|
104
|
+
actionpack (>= 4.0)
|
105
|
+
activesupport (>= 4.0)
|
106
|
+
sprockets (>= 3.0.0)
|
107
|
+
sqlite3 (1.3.12)
|
108
|
+
thor (0.19.4)
|
109
|
+
thread_safe (0.3.5)
|
110
|
+
tzinfo (1.2.2)
|
111
|
+
thread_safe (~> 0.1)
|
112
|
+
|
113
|
+
PLATFORMS
|
114
|
+
ruby
|
115
|
+
|
116
|
+
DEPENDENCIES
|
117
|
+
bundler (~> 1.11)
|
118
|
+
codeclimate-test-reporter (~> 1.0.0)
|
119
|
+
minitest (~> 5.0)
|
120
|
+
pluck_all!
|
121
|
+
rails (~> 4.2)
|
122
|
+
rake (~> 10.0)
|
123
|
+
simplecov
|
124
|
+
sqlite3 (~> 1.3)
|
125
|
+
|
126
|
+
BUNDLED WITH
|
127
|
+
1.11.2
|
data/gemfiles/5.0.gemfile
CHANGED
data/lib/pluck_all/version.rb
CHANGED
data/pluck_all.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["khiav reoy"]
|
10
10
|
spec.email = ["mrtmrt15xn@yahoo.com.tw"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{If you have a
|
12
|
+
spec.summary = %q{Pluck multiple attributes in Rails 3, 4, 5, and can return data as hash instead of only array.}
|
13
|
+
spec.description = %q{Pluck multiple attributes in Rails 3, 4, 5, and can return data as hash instead of only array. If you have a Rails 3 project, and want to pluck not only one column, feel free to use this gem and no need to worry about upgrading to Rails 4, 5 in the future will break this.}
|
14
14
|
spec.homepage = "https://github.com/khiav223577/pluck_all"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,96 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pluck_all
|
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:
|
11
|
+
date: 2017-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.11'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '5.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '5.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '3'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3'
|
83
|
-
description:
|
84
|
-
|
85
|
-
|
83
|
+
description: Pluck multiple attributes in Rails 3, 4, 5, and can return data as hash
|
84
|
+
instead of only array. If you have a Rails 3 project, and want to pluck not only
|
85
|
+
one column, feel free to use this gem and no need to worry about upgrading to Rails
|
86
|
+
4, 5 in the future will break this.
|
86
87
|
email:
|
87
88
|
- mrtmrt15xn@yahoo.com.tw
|
88
89
|
executables: []
|
89
90
|
extensions: []
|
90
91
|
extra_rdoc_files: []
|
91
92
|
files:
|
92
|
-
- .gitignore
|
93
|
-
- .travis.yml
|
93
|
+
- ".gitignore"
|
94
|
+
- ".travis.yml"
|
94
95
|
- CODE_OF_CONDUCT.md
|
95
96
|
- LICENSE.txt
|
96
97
|
- README.md
|
@@ -99,6 +100,7 @@ files:
|
|
99
100
|
- bin/setup
|
100
101
|
- gemfiles/3.2.gemfile
|
101
102
|
- gemfiles/4.2.gemfile
|
103
|
+
- gemfiles/4.2.gemfile.lock
|
102
104
|
- gemfiles/5.0.gemfile
|
103
105
|
- lib/pluck_all.rb
|
104
106
|
- lib/pluck_all/version.rb
|
@@ -113,19 +115,19 @@ require_paths:
|
|
113
115
|
- lib
|
114
116
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
117
|
requirements:
|
116
|
-
- -
|
118
|
+
- - ">="
|
117
119
|
- !ruby/object:Gem::Version
|
118
120
|
version: '0'
|
119
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
122
|
requirements:
|
121
|
-
- -
|
123
|
+
- - ">="
|
122
124
|
- !ruby/object:Gem::Version
|
123
125
|
version: '0'
|
124
126
|
requirements: []
|
125
127
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.4.8
|
127
129
|
signing_key:
|
128
130
|
specification_version: 4
|
129
|
-
summary:
|
130
|
-
|
131
|
+
summary: Pluck multiple attributes in Rails 3, 4, 5, and can return data as hash instead
|
132
|
+
of only array.
|
131
133
|
test_files: []
|