pluckex 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record_extension.rb +2 -2
- data/lib/pluckex/version.rb +1 -1
- metadata +2 -3
- data/README.rdoc +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6959e79ec183204a0f4f8273d1f60841139dc8bc
|
4
|
+
data.tar.gz: 8f3acaa30cf64ceffa57cdbbee46ed2dbcdf218b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7cf1a78f2954e87143ee259fede29f8410b9efd9b7a1571f89612bccb3b2434e38ec6ec1d75b7b9b4e2761d97fe0c735afbe5fa39460f2cd1b552c1af4474e7
|
7
|
+
data.tar.gz: 9af8f5078f8f9e191a258674012efdc4f0fb1913f92d4fe60fa07fff27d83eac1ed0a094f0c1085f6aed8ffba3ccbba532fe82124b6c984c0ce7a7e73c0dfe9d
|
@@ -9,9 +9,9 @@ module ActiveRecord
|
|
9
9
|
Hash[*self.pluck(*col_names).flatten]
|
10
10
|
end
|
11
11
|
|
12
|
-
# Person.
|
12
|
+
# Person.pluck_with_keys(:id, :name)
|
13
13
|
# # => [{:id=>1, :name=>'David'}, {:id=>2, :name=>'Jeremy'}, {:id=>3, :name=>'Jose'}]
|
14
|
-
def
|
14
|
+
def pluck_with_keys(*col_names)
|
15
15
|
self.pluck(*col_names).map do |element|
|
16
16
|
hash = {}
|
17
17
|
col_names.map.with_index do |col, i|
|
data/lib/pluckex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pluckex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kidachi_
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -32,7 +32,6 @@ extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
34
|
- MIT-LICENSE
|
35
|
-
- README.rdoc
|
36
35
|
- Rakefile
|
37
36
|
- config/routes.rb
|
38
37
|
- lib/active_record_extension.rb
|
data/README.rdoc
DELETED