destination_errors 0.0.3 → 0.0.4

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: a425c468a88a14f799f7650c32dc6afa790b4f45
4
- data.tar.gz: 7f07b07cbced15ee201fbad15bfc9a33885df374
3
+ metadata.gz: 2b0d1e913a5dd6b4ff6879838460b50edea24bb7
4
+ data.tar.gz: cba1186d7b96cefa43087297341d7e2a9928166a
5
5
  SHA512:
6
- metadata.gz: 8267d5fe775ea84c1adf3a2d78538a38693fd64ae2ceb6abf0a4affa31abb6aae1cca279d1788db1088a98514e9111bd97bb502c40f5c9df2910e1906ab1514a
7
- data.tar.gz: 596cbaae3b12a9c3babfd35b7f5f37be96389c0f032e520fcc5ec70783df25774b3cee39ac33c3d51606c51dcb3be6c92e85e14f5db2303f0f21c40add64ec80
6
+ metadata.gz: 199dc1f6c651a7f302a45b13bee6c9fd73f8b5ab69756b85baa7e846b8be369614b356d4e95ed56d0328b04d98c606341e6fbe85fe3b060aead713ffdec49654
7
+ data.tar.gz: e5f9fe80bfab3483c03604be00b8be04ee5e321448a534a3d6f776bfa9456374d2f7510ebc9bb3f13ec1ca1cf0ec38fbfb7ebbfcfc2081ce8af78d97656d0749
@@ -113,13 +113,13 @@ module DestinationErrors
113
113
  end
114
114
 
115
115
  def move_errors_from_surface_to_destination_if_needed(surface)
116
- if move_errors_from_surface?(surface)
116
+ if move_errors_from_surface?(surface) && error_destination
117
117
  (
118
118
  surface.nil? ?
119
- errors.full_messages :
120
- self.send(surface).errors.full_messages
121
- ).each do |message|
122
- move_error_to_destination(message)
119
+ errors.messages :
120
+ self.send(surface).errors.messages
121
+ ).each do |key, message|
122
+ move_error_to_destination(key, message)
123
123
  end
124
124
  end
125
125
  end
@@ -146,9 +146,11 @@ module DestinationErrors
146
146
  surface_errors_on.nil? || !self.send(surface_errors_on)
147
147
  end
148
148
 
149
- def move_error_to_destination(message)
150
- if error_destination
151
- error_destination.errors.add(:base, message)
149
+ def move_error_to_destination(key, message)
150
+ if error_destination.respond_to?(key)
151
+ error_destination.errors.add(key, *message)
152
+ else
153
+ error_destination.errors.add(:base, *message)
152
154
  end
153
155
  end
154
156
 
@@ -1,3 +1,3 @@
1
1
  module DestinationErrors
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: destination_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-22 00:00:00.000000000 Z
11
+ date: 2015-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel