objectstore 1.1.1 → 1.1.2

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
  SHA1:
3
- metadata.gz: 5b01afd45b0b361d4516aa18767c132e93401fab
4
- data.tar.gz: a46fdd53752e7a97eb61c4fc52e7240bb3c840aa
3
+ metadata.gz: 3236943c5074458941ff9c00a1aba785c347d641
4
+ data.tar.gz: ebb78024e581576a84bde92add4a39a12d17b667
5
5
  SHA512:
6
- metadata.gz: f338aadabbe06fba2f9f33d8f306e26be7b35c204b0bed4fc98237a4643e1a13c4322750943b7ff82569681ad08d333b4b19d861869a9a4c7087fdb6bf5e96ba
7
- data.tar.gz: 73103c73d496ac13040360a41fbd8692c602f2e321cf22fe07032f74e58a82ab0b82b57f6765ce96f96fc10e594565d65178f3c2490f79af32e39c95f3e49b4d
6
+ metadata.gz: fab4ae85a925ae2f04607844934f852dce4e5c98444a9eccb21c5bf933302ab38a1f7c161dd31e3040f0c6bb6080841e266fc7d1ca0bafeecfaa83d7467d705f
7
+ data.tar.gz: 133179d6e5dd12f5703fe7e55c067dcd4748636408a2afed263fe9d7d796c698fa0c99a226b41c552c9b1006b4210428a1d880f6e20df4eb9146a55953959eac
@@ -1,6 +1,6 @@
1
1
  module Atech
2
2
  module ObjectStore
3
- VERSION = '1.1.1'
3
+ VERSION = '1.1.2'
4
4
 
5
5
  ## Error class which all Object Store errors are inherited fro
6
6
  class Error < StandardError; end
@@ -26,8 +26,14 @@ module Atech
26
26
  ## Returns a new file object for the given ID. If no file is found a FileNotFound exception will be raised
27
27
  ## otherwise the File object will be returned.
28
28
  def self.find_by_id(id)
29
- result = File.execute_query("SELECT * FROM files WHERE id = #{id.to_i}").first || raise(FileNotFound, "File not found with id '#{id.to_i}'")
30
- self.new(result)
29
+ result = File.execute_query("SELECT * FROM files WHERE id = #{id.to_i}")
30
+ result = result.first if result
31
+
32
+ if result
33
+ self.new(result)
34
+ else
35
+ raise(FileNotFound, "File not found with id '#{id.to_i}'")
36
+ end
31
37
  end
32
38
 
33
39
  ## Imports a new file by passing a path and returning a new File object once it has been added to the database.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: objectstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke