pragma 1.0.0 → 1.1.0
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: 50ba068f5b924005a5e8f4d9c33c6e2bd125c418
|
4
|
+
data.tar.gz: 43ca9b386e7f1a6ad34324dc15f05d8e267a7416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67ef8ff72decf2fbb18dc94bbbcac24b377215e73400cf3c70262f3c25db4d3ba58cd6965ae380c02a26e36eb2a95f035c24ddecfe8474685a209625e7428362
|
7
|
+
data.tar.gz: 4f7b4500ad0ab5a832f583d1f23eeccc66c3075f579ee16b41d5f524b85e85c7e6290273aaff1572ca3a336fa021fbb55e6205b3e202209664fa01668b7953a8
|
@@ -9,15 +9,15 @@ module Pragma
|
|
9
9
|
include Pragma::Operation::Defaults
|
10
10
|
|
11
11
|
def call
|
12
|
-
record = build_record
|
13
|
-
contract = build_contract(record)
|
12
|
+
context.record = build_record
|
13
|
+
context.contract = build_contract(context.record)
|
14
14
|
|
15
|
-
validate! contract
|
16
|
-
authorize! contract
|
15
|
+
validate! context.contract
|
16
|
+
authorize! context.contract
|
17
17
|
|
18
|
-
contract.save
|
18
|
+
context.contract.save
|
19
19
|
|
20
|
-
respond_with status: :created, resource: decorate(record)
|
20
|
+
respond_with status: :created, resource: decorate(context.record)
|
21
21
|
end
|
22
22
|
|
23
23
|
protected
|
@@ -9,21 +9,21 @@ module Pragma
|
|
9
9
|
include Pragma::Operation::Defaults
|
10
10
|
|
11
11
|
def call
|
12
|
-
records = authorize_collection(find_records)
|
13
|
-
records = records.paginate(page: page, per_page: per_page)
|
12
|
+
context.records = authorize_collection(find_records)
|
13
|
+
context.records = context.records.paginate(page: page, per_page: per_page)
|
14
14
|
|
15
15
|
respond_with(
|
16
|
-
resource: decorate(records),
|
16
|
+
resource: decorate(context.records),
|
17
17
|
headers: {
|
18
|
-
'Page' => records.current_page.to_i,
|
19
|
-
'Per-Page' => records.per_page,
|
20
|
-
'Total' => records.total_entries
|
18
|
+
'Page' => context.records.current_page.to_i,
|
19
|
+
'Per-Page' => context.records.per_page,
|
20
|
+
'Total' => context.records.total_entries
|
21
21
|
},
|
22
22
|
links: {
|
23
23
|
first: build_page_url(1),
|
24
|
-
last: build_page_url(records.total_pages),
|
25
|
-
next: (build_page_url(records.next_page) if records.next_page),
|
26
|
-
prev: (build_page_url(records.previous_page) if records.previous_page)
|
24
|
+
last: build_page_url(context.records.total_pages),
|
25
|
+
next: (build_page_url(context.records.next_page) if context.records.next_page),
|
26
|
+
prev: (build_page_url(context.records.previous_page) if context.records.previous_page)
|
27
27
|
}
|
28
28
|
)
|
29
29
|
end
|
@@ -8,10 +8,10 @@ module Pragma
|
|
8
8
|
include Pragma::Operation::Defaults
|
9
9
|
|
10
10
|
def call
|
11
|
-
record = find_record
|
12
|
-
authorize! record
|
11
|
+
context.record = find_record
|
12
|
+
authorize! context.record
|
13
13
|
|
14
|
-
respond_with resource: decorate(record)
|
14
|
+
respond_with resource: decorate(context.record)
|
15
15
|
end
|
16
16
|
|
17
17
|
protected
|
@@ -9,15 +9,15 @@ module Pragma
|
|
9
9
|
include Pragma::Operation::Defaults
|
10
10
|
|
11
11
|
def call
|
12
|
-
record = find_record
|
13
|
-
contract = build_contract(record)
|
12
|
+
context.record = find_record
|
13
|
+
context.contract = build_contract(context.record)
|
14
14
|
|
15
|
-
validate! contract
|
16
|
-
authorize! contract
|
15
|
+
validate! context.contract
|
16
|
+
authorize! context.contract
|
17
17
|
|
18
|
-
contract.save
|
18
|
+
context.contract.save
|
19
19
|
|
20
|
-
respond_with resource: decorate(record)
|
20
|
+
respond_with resource: decorate(context.record)
|
21
21
|
end
|
22
22
|
|
23
23
|
protected
|
data/lib/pragma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pragma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Desantis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pragma-operation
|