active_remote 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/active_remote/errors.rb +12 -0
- data/lib/active_remote/search.rb +1 -1
- data/lib/active_remote/version.rb +1 -1
- data/spec/lib/active_remote/search_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c7f0a4fe63e5db8cf97d03eace3a0ab30b0a9d2
|
4
|
+
data.tar.gz: a0425f6fc8354604de9cc66b6ee328dd6e6a62c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a3675fb7c06e62058d678824d4b88ac1abf10c29ab532e5d73c15893d958cc621c073c6835f8f54028dc4a840de878dd327fef02d7f2479a2467328991c8a22
|
7
|
+
data.tar.gz: 921cbccf554f846c6d3359ace68ff30cf618b0ef6c2059252721e380adeacdb30e69495772ac7134e5f543b23363e2cc7669e65a9cc900c074721c950e1bc909
|
data/lib/active_remote/errors.rb
CHANGED
@@ -15,6 +15,18 @@ module ActiveRemote
|
|
15
15
|
# Raised by ActiveRemove::Base.find when remote record is not found when
|
16
16
|
# searching with the given arguments.
|
17
17
|
class RemoteRecordNotFound < ActiveRemoteError
|
18
|
+
attr_accessor :remote_record_class
|
19
|
+
|
20
|
+
def initialize(class_or_message = "")
|
21
|
+
message = class_or_message
|
22
|
+
|
23
|
+
if class_or_message.is_a?(Class)
|
24
|
+
self.remote_record_class = class_or_message
|
25
|
+
message = "#{remote_record_class} does not exist"
|
26
|
+
end
|
27
|
+
|
28
|
+
super(message)
|
29
|
+
end
|
18
30
|
end
|
19
31
|
|
20
32
|
# Raised by ActiveRemove::Base.save! and ActiveRemote::Base.create! methods
|
data/lib/active_remote/search.rb
CHANGED
@@ -25,6 +25,10 @@ describe ActiveRemote::Search do
|
|
25
25
|
it "raise an exception" do
|
26
26
|
expect { Tag.find(args) }.to raise_error(::ActiveRemote::RemoteRecordNotFound)
|
27
27
|
end
|
28
|
+
|
29
|
+
it "gives the class of the remote record not found in the message" do
|
30
|
+
expect { Tag.find(args) }.to raise_error(::ActiveRemote::RemoteRecordNotFound, /Tag/)
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hutchison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|