uuids 2.0.0 → 3.0.0

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: 47eac9c29e60c9923b3ccc38491475e2090447f4
4
- data.tar.gz: da49a4fb5fe1cac362c92521d2a5a79691f97a2a
3
+ metadata.gz: bfc2367f33f47dad9657d2967ce4b748e250d74d
4
+ data.tar.gz: 65bdc11b1153c8a642d8db7cf955551d40f30598
5
5
  SHA512:
6
- metadata.gz: f8fd6392d538cb0b819b1d3a54e691b180a60b50f85142cd69b855f3b471782b794eadbd5aeace541ee0b69b866e88f2f0a495047f0bd48462aca24afc59db6c
7
- data.tar.gz: c9823e9694e4b849ee54f78b64aa96804830d43d0963c887dbd5b3c3a2db8987f301dda4c18f71b8381b999b15b9a670723ead18703c8db475b91aa91059fd1e
6
+ metadata.gz: 3727f692aa29305a27f71e6f4a014cecd51f44994093d8045582e69a15124e6a366122a66d135e1536d294ae7ec8a94652b259a0a6045e84a70a49bff85e082b
7
+ data.tar.gz: b84266c8b36f76e2540c7706dc31656606c1eb61dbfbc9fc1eeb3a5e149e69e9b6d65ef9ee7d1080fbb1f696fb3ac9aebcd950695cbc19a91908818bf2043e8f
@@ -25,6 +25,7 @@ module Uuids
25
25
  # @param values [Array<String>] a list of uuids to select records by.
26
26
  # @return [ActiveRecord::Relation] scope.
27
27
  def by_uuid(*values)
28
+ return all unless values.any?
28
29
  first_value = values.first
29
30
  list = first_value.is_a?(Array) ? first_value : values
30
31
  joins(:uuids).where(uuids_uuids: { value: list }).uniq
data/lib/uuids/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Uuids
2
2
 
3
3
  # Current release.
4
- VERSION = "2.0.0"
4
+ VERSION = "3.0.0"
5
5
  end
Binary file
@@ -60,6 +60,7 @@ module Uuids
60
60
  subject.uuids.create!
61
61
  values = subject.reload.uuids.map(&:value)
62
62
  expect(City.by_uuid(*values).to_a).to eq [subject]
63
+ expect(City.by_uuid).to eq City.all
63
64
  end
64
65
 
65
66
  it "creates the first uuid by default" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uuids
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kozin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-25 00:00:00.000000000 Z
11
+ date: 2014-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord