mite-rb 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/mite-rb.rb +2 -1
- data/lib/mite/activeresource_patch.rb +24 -0
- data/lib/mite/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a364e42b20e1729d93db5dc2afa04031a73d549
|
4
|
+
data.tar.gz: 30d8911c095ec2e69a22d7f5fb0ab18a8682a229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37e4c26fa50f63013dcb87f7e6653ed6dbf9145c530d2bb632e39bc02ab33c7100ef9893394892c0a5f842219c2528bb521d683aae6ee8c08014e7ad5a6ca833
|
7
|
+
data.tar.gz: 92a973d1dc86ee42d1ccd878edf6ce18681e0e714e984ec0b783063e659a1f2f10e9ee1f1f761be73ed4ba322acd3356d7ca380b1164d42f4f66a0561e742286
|
data/CHANGES.md
CHANGED
data/lib/mite-rb.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
require "active_resource/validations"
|
2
|
+
|
3
|
+
module ActiveResource
|
4
|
+
class Errors < ActiveModel::Errors
|
5
|
+
def from_json(json, save_cache = false)
|
6
|
+
decoded = ActiveSupport::JSON.decode(json) || {} rescue {}
|
7
|
+
from_hash decoded, save_cache
|
8
|
+
end
|
9
|
+
|
10
|
+
def from_hash(messages, save_cache = false)
|
11
|
+
clear unless save_cache
|
12
|
+
|
13
|
+
messages.each do |(key,errors)|
|
14
|
+
Array(errors).each do |error|
|
15
|
+
if key == 'base'
|
16
|
+
self[:base] << error
|
17
|
+
else
|
18
|
+
add key, error
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/mite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mite-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Munz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- Rakefile
|
40
40
|
- lib/mite-rb.rb
|
41
41
|
- lib/mite/account.rb
|
42
|
+
- lib/mite/activeresource_patch.rb
|
42
43
|
- lib/mite/customer.rb
|
43
44
|
- lib/mite/myself.rb
|
44
45
|
- lib/mite/project.rb
|