quandl_client 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -13,19 +13,31 @@ module Properties
|
|
13
13
|
before_save :halt_unless_valid!
|
14
14
|
|
15
15
|
def valid_with_server?
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
return false unless valid_without_server?
|
17
|
+
return false unless errors_params.blank?
|
18
|
+
return false unless errors_server.blank?
|
19
|
+
true
|
19
20
|
end
|
20
21
|
alias_method_chain :valid?, :server
|
21
22
|
|
22
23
|
def error_messages
|
23
24
|
valid?
|
24
|
-
|
25
|
-
e = self.attributes[:errors] || {}
|
26
|
-
m.deep_merge(e)
|
25
|
+
errors_client.deep_merge(errors_server).deep_merge(errors_params)
|
27
26
|
end
|
28
27
|
|
28
|
+
def errors_client
|
29
|
+
errors.messages || {}
|
30
|
+
end
|
31
|
+
|
32
|
+
def errors_server
|
33
|
+
self.attributes[:errors] || {}
|
34
|
+
end
|
35
|
+
|
36
|
+
def errors_params
|
37
|
+
response_errors.present? ? { response_errors: response_errors } : {}
|
38
|
+
end
|
39
|
+
|
40
|
+
|
29
41
|
protected
|
30
42
|
|
31
43
|
def halt_unless_valid!
|