betty_resource 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +6 -0
- data/README.md +3 -1
- data/lib/betty_resource/model/record.rb +2 -2
- data/lib/betty_resource/version.rb +1 -1
- data/test/unit/model/test_record.rb +10 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 148310e456e98182ff24114e871e89ebd2c50338
|
4
|
+
data.tar.gz: 1e661ff1d9ccae22628624b9256b12ebe82a1b8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b73a5412fba2fa5580b61ea7e8929e16a1df55acb1de9a381959a1272ae5adfcb53959c233c0fb23f09a7a373c8946311751db891badc894d7cb6340dab8d73
|
7
|
+
data.tar.gz: d4e0067aed266f7e49312eb307197076d0a4cd2dfe864ffa06c04ec82a4ec05f1bbdf3c4a6fa3cf50acfeecbd876be1334f1b79a641351d5da7ffeea7f0e5d86
|
data/CHANGELOG.rdoc
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Code Climate](https://codeclimate.com/github/bettyblocks/betty_resource.png)](https://codeclimate.com/github/bettyblocks/betty_resource)
|
2
|
+
|
1
3
|
# BettyResource
|
2
4
|
|
3
5
|
Map Betty5 application resources to Ruby objects through the JSON API!
|
@@ -90,4 +92,4 @@ For support, remarks and requests, please mail us at [support@bettyblocks.com](m
|
|
90
92
|
|
91
93
|
Copyright (c) 2013 BettyBlocks B.V.
|
92
94
|
|
93
|
-
[http://bettyblocks.com](http://bettyblocks.com) - [info@bettyblocks.com](mailto:info@bettyblocks.com)
|
95
|
+
[http://bettyblocks.com](http://bettyblocks.com) - [info@bettyblocks.com](mailto:info@bettyblocks.com)
|
@@ -69,7 +69,7 @@ module BettyResource
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
|
72
|
+
result.success?.tap do |success|
|
73
73
|
if success
|
74
74
|
model.send :load, result.parsed_response, self
|
75
75
|
else
|
@@ -92,7 +92,7 @@ module BettyResource
|
|
92
92
|
private
|
93
93
|
|
94
94
|
def to_params
|
95
|
-
{:body => {:record => attributes_as_json}}
|
95
|
+
{:body => {:record => attributes_as_json}, :headers => {"Content-Type" => "application/json"}}
|
96
96
|
end
|
97
97
|
|
98
98
|
# TODO: Test this update
|
@@ -58,7 +58,7 @@ module Unit
|
|
58
58
|
assert_equal({"id" => nil, "first_name" => "Paul", "last_name" => "Engel"}, relation.as_json)
|
59
59
|
|
60
60
|
relation = BettyResource::Relation.get(1)
|
61
|
-
assert_equal({"id" => 1, "first_name" => "Daniel", "last_name" => "Willemse", "group"=>{"id"=>1}}, relation.as_json)
|
61
|
+
assert_equal({"id" => 1, "first_name" => "Daniel", "last_name" => "Willemse", "group"=>{"id"=>1, "name" => "group one"}}, relation.as_json)
|
62
62
|
assert_equal({"id" => 1, "name" => "group one"}, relation.group.as_json)
|
63
63
|
end
|
64
64
|
|
@@ -72,6 +72,15 @@ module Unit
|
|
72
72
|
assert_equal "Kaag", relation.last_name
|
73
73
|
end
|
74
74
|
|
75
|
+
it "should save itself when an %-character is used" do
|
76
|
+
relation = BettyResource::Relation.new(:first_name => "Stephan%")
|
77
|
+
assert relation.save
|
78
|
+
assert relation.id > 0
|
79
|
+
|
80
|
+
relation = BettyResource::Relation.get(relation.id)
|
81
|
+
assert_equal "Stephan%", relation.first_name
|
82
|
+
end
|
83
|
+
|
75
84
|
it "should not save itself when invalid (first_name is required)" do
|
76
85
|
relation = BettyResource::Relation.new
|
77
86
|
assert !relation.save
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: betty_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chiel Wester
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: httparty
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.0.
|
149
|
+
rubygems_version: 2.0.3
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Map Betty5 application resources to Ruby objects
|
@@ -156,3 +156,4 @@ test_files:
|
|
156
156
|
- test/unit/test_base.rb
|
157
157
|
- test/unit/test_configuration.rb
|
158
158
|
- test/unit/test_model.rb
|
159
|
+
has_rdoc:
|