rest_my_case 1.11.5 → 1.11.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2edc1683cfac54d73e202db382869d8c50be5ce
|
4
|
+
data.tar.gz: 19425b028f784e2725900da5e083cb2d2db0d87d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 447a37cb0f32a72b7153cf76ae15678c5489e5846f3ad3854399b3a252ba75118cf5db4291d5cc391725360f47a054a1390757c5ec86f4fe7243944b706b9675
|
7
|
+
data.tar.gz: eed1d526260974554e624cdd593ce24c27cf3fed83710c89a7e02fc9dc5b88e419c7dd6786c3175951968009b856fb036b174e49eb07339e7115031c0e748534
|
data/README.md
CHANGED
@@ -247,6 +247,7 @@ Methods | Behaviour
|
|
247
247
|
------- | ---------
|
248
248
|
**#attributes** | Alias to **#marshal_dump**, returns all of the context's stored data.
|
249
249
|
**#to_hash** | Serializes and unserializes **#attributes** turning any existing ruby objects into serialized strings.
|
250
|
+
**#values_at(*keys)** | Short for **#attributes.values_at(*keys)**, returns an array with correspondent values for each key.
|
250
251
|
**#valid?** | Checks if **#errors** is empty
|
251
252
|
**#ok?** | Alias to **#valid?**
|
252
253
|
**#success?** | Alias to **#ok?**
|
data/lib/rest_my_case/version.rb
CHANGED
@@ -41,6 +41,15 @@ describe RestMyCase::Base do
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
context "When the required_context of a class fails and one of the dependencies aborts first" do
|
45
|
+
before { @context = RequiredContext::Comments::Update.perform }
|
46
|
+
|
47
|
+
xit "required_context should not have ran" do
|
48
|
+
binding.pry
|
49
|
+
# expect(@context.current_user).to be nil
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
44
53
|
end
|
45
54
|
|
46
55
|
end
|
@@ -65,4 +65,24 @@ module RequiredContext
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
module Comments
|
69
|
+
class FindOne < RestMyCase::Base
|
70
|
+
def perform
|
71
|
+
error!(:not_found)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
class AssignAttributes < RestMyCase::Base
|
76
|
+
required_context :comment
|
77
|
+
end
|
78
|
+
|
79
|
+
class Save < RestMyCase::Base
|
80
|
+
required_context :comment
|
81
|
+
end
|
82
|
+
|
83
|
+
class Update < RestMyCase::Base
|
84
|
+
depends FindOne, AssignAttributes, Save
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
68
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_my_case
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goncalvesjoao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|