pluckeroid 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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDJmYmU0ZTQ2NmJjOWFkNzY2YTA5ZWFmZDdiMjI3ZjhlOGFhNTMzZQ==
4
+ MzNmZjlmNTJlZTI0MTYyY2JjZWFmNTdhYzRjNmFjN2M4NWJhZTY3ZA==
5
5
  data.tar.gz: !binary |-
6
- MDA3YmFlZmQ3Nzg4YzI3ZmUxNzdlODQ0NmMwZTI3YmM2ZjY2NjEwMw==
6
+ MTY3Njc1MjE5MWIwNmM5OWYxODcxN2JhYzJiYmZlMDI5ZjY0MjUzMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWM4ZTc5ODQwNzE4NzE3YzRkZGZmMjUyODE5MGNiMDA3YzFiMTg3Y2NlZjM3
10
- ZDk4Yjg5MzAzYTk2NzM1NjEyYjljNGViNzQ0MDllY2VhMjQ2MzQ3MmE5M2U2
11
- YmQxYTBmY2QxM2RjNGNjNjUwZjVmMjgyOTFlOWE5Mzg5NTU3ZTA=
9
+ ZGVkNGE4MWZiZWVmZWQ1NzNjOThiNzIzNGE0N2M0NDlhMTc5Y2FhMmM2Njg4
10
+ MjQ2ZWQ5NzVhNzI3MTYxNTQxNWVjYjQyZWUxZjgzZTNjOWU2ZTFjZWQwOWRl
11
+ ODhjMDhlMzM0NTkzN2RjOTVhOTMxYmQ2NTBiODA4YzhlNjZkMDA=
12
12
  data.tar.gz: !binary |-
13
- ZGFjMTdhYWFmMzdhN2I4NWZiZDFhOTdmNzZmNzVmNjFmMTQ2M2JhMTE2Yjcz
14
- NzQ3N2YzNDU4MmYxZjQ1NWFkZmI0NjgyNWRmYmM3NTgzNjE1YTdhZjE2YjIz
15
- ZmE2ZDgxMDk2YTI0ZmE4NzUzY2ExZDI1YWQxOGU1NzRiNmU3OGU=
13
+ YTBhZTcyZTljNzRmZmExNDFmMTBkNWViODFiNzhmZjU1MGIwZjQ1NDJmOTNh
14
+ NTIxZDA4OGRmNGMwMDIxNGE0ZDA2NjRhNDYwOWFhZjk1NDI4ZGRiZDA3N2Jk
15
+ NzllYjc1MjhiYzBjMjVkYWU5MTI0YmM3ZTM2MDE0NzA2MWYzZjc=
@@ -29,10 +29,10 @@ module Pluckeroid
29
29
  # Examples:
30
30
  #
31
31
  # Person.pluck(:id) # SELECT people.id FROM people
32
- # => [1, 2]
32
+ # # => [1, 2]
33
33
  #
34
34
  # Person.pluck(:id, :name) # SELECT people.id, people.name FROM people
35
- # => [[1, 'Obi-Wan'], [2, 'Luke']]
35
+ # # => [[1, 'Obi-Wan'], [2, 'Luke']]
36
36
  #
37
37
  def pluck(*column_names)
38
38
  flatten = column_names.size == 1
@@ -54,12 +54,12 @@ module Pluckeroid
54
54
 
55
55
  protected
56
56
 
57
- def pluck_columns(column_names)
58
- if column_names.size.zero?
57
+ def pluck_columns(columns)
58
+ if columns.size.zero?
59
59
  raise ArgumentError, 'wrong number of arguments (0 for 1)'
60
60
  end
61
61
 
62
- column_names = column_names.map do |column_name|
62
+ columns = columns.map do |column_name|
63
63
  if Symbol === column_name && column_names.include?(column_name.to_s)
64
64
  "#{connection.quote_table_name(table_name)}.#{connection.quote_column_name(column_name)}"
65
65
  else
@@ -68,7 +68,7 @@ module Pluckeroid
68
68
  end
69
69
 
70
70
  relation = clone
71
- relation.select_values = column_names
71
+ relation.select_values = columns
72
72
  klass.connection.select_all(relation.arel).map! do |attributes|
73
73
  yield klass.initialize_attributes(attributes)
74
74
  end
@@ -1,3 +1,3 @@
1
1
  module Pluckeroid
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pluckeroid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimko