occams-record 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 518642e93828544e82cbd6fbe872ec9f66b54a7fc623f4932290169d6738063a
4
- data.tar.gz: e17b2fa8b6721c51924bc2dc36ac0ba7e5617453cdd777a0f7851c7a3a289823
3
+ metadata.gz: 0f92b611f104c0a5644c7caa0ca6aa57f7beffa381d3579490a475fb1c388d51
4
+ data.tar.gz: 2b399f8bbd15b0bfd1859533431432b5607a841448cb5d112e21f60090edb997
5
5
  SHA512:
6
- metadata.gz: 3567df987763a1a12f8b06b062a9b09d40b53d0fa189e1e99dc1b99b2653a2f97b5332095433bdbdcea8e1f6cb35db74ef2c98cd97d72bcecd1cc9f4a9260c4b
7
- data.tar.gz: 0cdca12e6a024a61be923efc5d4f4bbebb744751dbc53fc56f02f1bc8733ef5c8d694e27c3235bd4d921efc1eda570af34b580f8f8558e3399ddbefb0371b7b8
6
+ metadata.gz: 67fdf0377759ccb13e6d59abda9e87f4a30d4be4431f4e92cf16b0cd430bfcdc74afa05cd9d0c178a0b80cc3afbfcdae292db1f53fef0c6facbceda4f49a5223
7
+ data.tar.gz: 8d88fc8bdb242090bf0f0a833075733fb6b05a09441bd235e2e7eb02cac6dd3ef9a8463539d28edf531b3b17474b74b5d5cfdedf45df62f89212ac649bbc216f
@@ -38,6 +38,7 @@ module OccamsRecord
38
38
 
39
39
  include Batches
40
40
  include EagerLoaders::Builder
41
+ include Enumerable
41
42
 
42
43
  #
43
44
  # Initialize a new query.
@@ -99,13 +100,12 @@ module OccamsRecord
99
100
  end
100
101
 
101
102
  #
102
- # Run the query and return the first result (which could be nil). This WILL append a LIMIT 1 to the query.
103
+ # Run the query and return the first result (which could be nil) by using LIMIT 1.
103
104
  #
104
105
  # @return [OccamsRecord::Results::Row]
105
106
  #
106
107
  def first
107
- scope.limit! 1
108
- run[0]
108
+ run { |q| q.limit 1 }.first
109
109
  end
110
110
 
111
111
  #
@@ -52,6 +52,7 @@ module OccamsRecord
52
52
 
53
53
  include Batches
54
54
  include EagerLoaders::Builder
55
+ include Enumerable
55
56
 
56
57
  #
57
58
  # Initialize a new query.
@@ -3,5 +3,5 @@
3
3
  #
4
4
  module OccamsRecord
5
5
  # Library version
6
- VERSION = '0.22.0'.freeze
6
+ VERSION = '0.23.0'.freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occams-record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Hollinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-13 00:00:00.000000000 Z
11
+ date: 2018-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord