ocean-dynamo 0.1.12 → 0.1.13

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: 57c8794d00ec0fee8e6c820e773072449d3c6fa8
4
- data.tar.gz: 0626caa9717aeccd8d927b6e586a5915b5fd6316
3
+ metadata.gz: 74c7e10d51de039a64fc18d60408e3a1a0c9b7f4
4
+ data.tar.gz: e71adf734d5c6cbde2b2ade2b0b251514c2a9abc
5
5
  SHA512:
6
- metadata.gz: ab7dfe59f45ef9effbb70f4fd9d918578f949f8996eac431197960aa74fd6bdc40d7f16cf0aaca72066c19ebc712d78e01b1ffeb75b39a74637e0920b2cdc02d
7
- data.tar.gz: bea89734ed3538b7e00e9d82deef3670f56a92dfb7dabec85022a419d658a98e377a1c392478a6b41047a205218de75b9d80c8dbeabf174fa18424779bee8fd4
6
+ metadata.gz: b50cc6aeac65b2a4c1f51e390e0f6d443559507bffcee8f9a13aee347e0e8b06e4aa49d10af2afec8787a6ada8eb82f6902089b68835d07a380444813b8ad0cb
7
+ data.tar.gz: a12992af3f67eb5d237096e9877506b9ba0b01d101b4c7e2a8e37ad51c8c80c8f07812fc19cc7c3cc61bb70e69c398041a8169a9b8db90f4032e853a4278f88a
@@ -16,7 +16,14 @@ module OceanDynamo
16
16
 
17
17
  class RecordNotSaved < DynamoError; end
18
18
 
19
- class RecordInvalid < DynamoError; end
19
+ class RecordInvalid < DynamoError
20
+ attr_reader :record # :nodoc:
21
+ def initialize(record) # :nodoc:
22
+ @record = record
23
+ errors = @record.errors.full_messages.join(", ")
24
+ super(I18n.t(:"#{@record.class.i18n_scope}.errors.messages.record_invalid", :errors => errors, :default => :"errors.messages.record_invalid"))
25
+ end
26
+ end
20
27
 
21
28
  class RecordNotDestroyed < DynamoError; end
22
29
 
@@ -77,7 +77,7 @@ module OceanDynamo
77
77
  if perform_validations(options)
78
78
  create_or_update || raise(RecordNotSaved)
79
79
  else
80
- raise RecordInvalid
80
+ raise RecordInvalid.new(self)
81
81
  end
82
82
  end
83
83
 
@@ -1,3 +1,3 @@
1
1
  module OceanDynamo
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-dynamo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson