collectionadapters 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: 80a678b0765768108c65062a11887800f8ce44c53b4bfaf3f5b3ba73fb936cf3
4
- data.tar.gz: 95ccc58f21132bc6bb24844529be539b0f929d0035c15d42be35679ba7db9bd7
3
+ metadata.gz: 9c32945a66d4431f74cc2e3085cab79150b234c5e67cbea22e2f38d97dece3d9
4
+ data.tar.gz: 223017655c0bb7404ca489b18ce4fa2fe854873f354cae99667d4f7043d0331a
5
5
  SHA512:
6
- metadata.gz: 26aa5653ae9e9b288030708a05b7b5ab87598bba0574493b68abb4f599d1ac0a8933ed5f58db55c6760da553cd17a4c00865aa4f9eb5a71c591c7f45cb6089e4
7
- data.tar.gz: 8b612237e037d8923be8db0e02c7fb603362e5af113c0e57577092815a080d679f6aeec0635f9e5907fd446ef1406efac17c514d357ce3688cf4b3b52e7bfcda
6
+ metadata.gz: 6857663403eb0dd48b8919685a611121a1a4c4b63f9463cb0d663358d2cc244e85d2aab23bf8bc844b3bae075d6cc7f690b4fe2aedafced84baf4dd343521746
7
+ data.tar.gz: 03c49ee091a398585e3b940847e227928dbd8d145fbdeee49f691de693c65f708aad922f0c993df56fcbe0f9099fbd9639a863f038366f0d4ece8c0a6271bcca
@@ -1,7 +1,8 @@
1
1
  module CollectionAdapters
2
2
  class ArraySequel
3
3
  def initialize model:, column:
4
- @model = model
4
+ @ds = model
5
+ @model = model.kind_of?(Sequel::Dataset) ? @ds.model : @ds
5
6
  @col = column.to_sym
6
7
  end
7
8
 
@@ -24,8 +25,8 @@ module CollectionAdapters
24
25
  end
25
26
 
26
27
  def shift
27
- @model.db.transaction do
28
- if ob = @model.for_update.first
28
+ @ds.db.transaction do
29
+ if ob = @ds.for_update.first
29
30
  v = ob.values[@col]
30
31
  return v if ob.delete
31
32
  raise Sequel::rollback
@@ -35,5 +36,3 @@ module CollectionAdapters
35
36
  end
36
37
  end
37
38
  end
38
-
39
-
@@ -1,3 +1,3 @@
1
1
  module Collectionadapters
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collectionadapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-06 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler