decko 0.8.1 → 0.8.2

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: 6d564aabea73f64c6c82027d94cd2dae7ef660d4
4
- data.tar.gz: 19ded811c602efcd6786257ff7ff80c25d11aa91
3
+ metadata.gz: 642815d92ad953b7592dce3a40979bbfeca2c165
4
+ data.tar.gz: 659af51030b921c81935f537e36a814dab19de02
5
5
  SHA512:
6
- metadata.gz: '09ded0970b93c0107b0031e01b71967ec340125ccc399206e88467d68afed688e20d43ffbacbd592db31139f09701f53f55cda5779a458095f0a2156119c16b3'
7
- data.tar.gz: 0f2f808a2b53e88f430f094802be9397d36069cee3b6dd7ec5525b6457fa5f61afdc41f5eb43202ece25549a687b574e75771493e5dfa8316ab7ba287f9f6f55
6
+ metadata.gz: 2021baf4e67d92765bf9dae7f962f013827aebaa1410bfa9c82e43670e6ae8cbca7ec5f8cf7ae68c547a4fd92f68105982bfd0a9427f7fa7effb5a56e4018277
7
+ data.tar.gz: 7f4b764d3170f489fb1a938d45f9d168af473d003fcb813ac3b060eaf72ade8391a2b1ddef631a30997f7f6b20b8aba73761ada4b420889a9bef880ea542079d
@@ -17,7 +17,7 @@ module Decko
17
17
  end
18
18
 
19
19
  # return a redirect response
20
- def hard_redirect url
20
+ def hard_redirect url, status=302
21
21
  url = card_url url # make sure we have absolute url
22
22
  if Card::Env.ajax?
23
23
  # lets client reset window location
@@ -25,7 +25,7 @@ module Decko
25
25
  # formerly used 303 response, but that gave IE the fits
26
26
  render json: { redirect: url }
27
27
  else
28
- redirect_to url
28
+ redirect_to url, status: status
29
29
  end
30
30
  end
31
31
 
@@ -55,8 +55,8 @@ paths:
55
55
  - $ref: '#/components/parameters/card'
56
56
  - $ref: '#/components/parameters/success'
57
57
  responses:
58
- 200:
59
- $ref: '#/components/responses/200'
58
+ 302:
59
+ $ref: '#/components/responses/302'
60
60
  404:
61
61
  $ref: '#/components/responses/404'
62
62
  # TODO: add patch
@@ -68,8 +68,8 @@ paths:
68
68
  - $ref: '#/components/parameters/cardmark'
69
69
  - $ref: '#/components/parameters/success'
70
70
  responses:
71
- 200:
72
- $ref: '#/components/responses/200'
71
+ 302:
72
+ $ref: '#/components/responses/302'
73
73
  404:
74
74
  $ref: '#/components/responses/404'
75
75
  /:
@@ -85,10 +85,8 @@ paths:
85
85
  - $ref: '#/components/parameters/card'
86
86
  - $ref: '#/components/parameters/success'
87
87
  responses:
88
- 200:
89
- $ref: '#/components/responses/200'
90
- 404:
91
- $ref: '#/components/responses/404'
88
+ 302:
89
+ $ref: '#/components/responses/302'
92
90
 
93
91
  externalDocs:
94
92
  description: Find out more about Decko
@@ -248,7 +246,8 @@ components:
248
246
 
249
247
  responses:
250
248
  200:
251
- description: "card data"
249
+ description: |-
250
+ Card data. Defaults to molecule view.
252
251
  content:
253
252
  application/json:
254
253
  schema:
@@ -258,4 +257,8 @@ components:
258
257
  content:
259
258
  application/json:
260
259
  schema:
261
- $ref: '#/components/schemas/errors%20view'
260
+ $ref: '#/components/schemas/errors%20view'
261
+ 302:
262
+ description: |-
263
+ Successful non-idempotent requests redirect to idempotent GET
264
+ requests.
@@ -93,19 +93,19 @@ class CardController < ActionController::Base
93
93
  def handle
94
94
  card.act do
95
95
  Card::Env.success card.name
96
- yield ? render_success : raise(Card::Error::UserError)
96
+ yield ? cud_success : raise(Card::Error::UserError)
97
97
  end
98
98
  end
99
99
 
100
- # successful create, update, or delete action
101
- def render_success
100
+ # successful create, update, or delete act
101
+ def cud_success
102
102
  success = Card::Env.success.in_context card.name
103
103
  if success.reload?
104
104
  reload
105
105
  elsif Card::Env.ajax? && !success.hard_redirect?
106
106
  soft_redirect success
107
107
  else
108
- hard_redirect success.to_url
108
+ hard_redirect success.to_url, 303
109
109
  end
110
110
  end
111
111
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-08-01 00:00:00.000000000 Z
14
+ date: 2019-08-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: card
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.98.1
22
+ version: 1.98.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.98.1
29
+ version: 1.98.2
30
30
  description: a wiki approach to stuctured data, dynamic interaction, and web design
31
31
  email:
32
32
  - info@decko.org