logical_model 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/logical_model.rb +3 -0
- data/logical_model.gemspec +1 -1
- data/spec/client_spec.rb +6 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.7
|
data/lib/logical_model.rb
CHANGED
@@ -58,6 +58,8 @@ class LogicalModel
|
|
58
58
|
|
59
59
|
# TODO clean this file refactoring into modules
|
60
60
|
|
61
|
+
attr_accessor :last_response_code
|
62
|
+
|
61
63
|
def self.attribute_keys=(keys)
|
62
64
|
@attribute_keys = keys
|
63
65
|
attr_accessor *keys
|
@@ -448,6 +450,7 @@ class LogicalModel
|
|
448
450
|
Timeout::timeout(self.class.timeout/1000) do
|
449
451
|
response = Typhoeus::Request.post( self.class.resource_uri, :body => params, :timeout => self.class.timeout )
|
450
452
|
end
|
453
|
+
self.last_response_code = response.code
|
451
454
|
if response.code == 201 || response.code == 202
|
452
455
|
log_ok(response)
|
453
456
|
if self.respond_to?('id=')
|
data/logical_model.gemspec
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -29,6 +29,9 @@ describe "LogicalModel User client" do
|
|
29
29
|
it "should return true" do
|
30
30
|
@ret.should be_true
|
31
31
|
end
|
32
|
+
it "should store code in last_response_code" do
|
33
|
+
@user.last_response_code.should == 201
|
34
|
+
end
|
32
35
|
end
|
33
36
|
context "if response is code 202" do
|
34
37
|
before(:each) do
|
@@ -42,6 +45,9 @@ describe "LogicalModel User client" do
|
|
42
45
|
it "should create a user" do
|
43
46
|
@user.should_not be_nil
|
44
47
|
end
|
48
|
+
it "should store code in last_response_code" do
|
49
|
+
@user.last_response_code.should == 202
|
50
|
+
end
|
45
51
|
it "should set an id" do
|
46
52
|
@user.id.should_not be_nil
|
47
53
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logical_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -346,7 +346,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
346
346
|
version: '0'
|
347
347
|
segments:
|
348
348
|
- 0
|
349
|
-
hash:
|
349
|
+
hash: 421922081
|
350
350
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
351
351
|
none: false
|
352
352
|
requirements:
|