active_remote 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -76,7 +76,8 @@ module ActiveRemote
76
76
  def delete
77
77
  raise ReadOnlyRemoteRecord if readonly?
78
78
  execute(:delete, attributes.slice("guid"))
79
- freeze if success?
79
+
80
+ return success? ? freeze : false
80
81
  end
81
82
 
82
83
  # Deletes the record from the service (the service determines if the
@@ -98,7 +99,8 @@ module ActiveRemote
98
99
  def destroy
99
100
  raise ReadOnlyRemoteRecord if readonly?
100
101
  execute(:destroy, attributes.slice("guid"))
101
- freeze if success?
102
+
103
+ return success? ? freeze : false
102
104
  end
103
105
 
104
106
  # Destroys (hard deletes) the record from the service and freezes this
@@ -1,3 +1,3 @@
1
1
  module ActiveRemote
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
@@ -53,6 +53,14 @@ describe ActiveRemote::Persistence do
53
53
  subject.frozen?.should be_true
54
54
  end
55
55
  end
56
+
57
+ context "when the record has errors" do
58
+ before { subject.stub(:has_errors?).and_return(true) }
59
+
60
+ it "returns false" do
61
+ subject.delete.should be_false
62
+ end
63
+ end
56
64
  end
57
65
 
58
66
  describe "#delete!" do
@@ -88,6 +96,14 @@ describe ActiveRemote::Persistence do
88
96
  subject.frozen?.should be_true
89
97
  end
90
98
  end
99
+
100
+ context "when the record has errors" do
101
+ before { subject.stub(:has_errors?).and_return(true) }
102
+
103
+ it "returns false" do
104
+ subject.destroy.should be_false
105
+ end
106
+ end
91
107
  end
92
108
 
93
109
  describe "#destroy!" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-25 00:00:00.000000000 Z
12
+ date: 2013-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: active_attr
@@ -218,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  segments:
220
220
  - 0
221
- hash: -3364486673582194034
221
+ hash: 432433655534443133
222
222
  required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  none: false
224
224
  requirements:
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  segments:
229
229
  - 0
230
- hash: -3364486673582194034
230
+ hash: 432433655534443133
231
231
  requirements: []
232
232
  rubyforge_project:
233
233
  rubygems_version: 1.8.24