undercarriage 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -3
- data/lib/undercarriage/controllers/restful/actions/create_concern.rb +13 -7
- data/lib/undercarriage/controllers/restful/actions/destroy_concern.rb +7 -2
- data/lib/undercarriage/controllers/restful/actions/update_concern.rb +13 -7
- data/lib/undercarriage/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a9348f83d9d2e3924e13edfcb27bcea2a7602479195298e5f9e95ce646e8cb2
|
4
|
+
data.tar.gz: 2f6fe5126d7b6d4db2429118dc9343f30c76609766d313937cf26790cf5ad7e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e10bb005e424d5e25984ccbb92d3bf44b53ce0d4d48d220ef3f71ddc7d884f6bd97a803732c69583ea10dc15704a3d7c5dfd8ebb2548a1ade20c013344d3b8e3
|
7
|
+
data.tar.gz: deb15ab41c1b0c027017c363028a4beabed9a0b92741efb418ec3d8592eb2289ac871f70c947140a7afa2e93c38175d84eae17a98c89466d902510a04501b0d6
|
data/README.md
CHANGED
@@ -11,14 +11,14 @@ Undercarriage is a set of concerns to add to your application to trim some of th
|
|
11
11
|
## Requirements
|
12
12
|
|
13
13
|
* Ruby >= 2.5
|
14
|
-
* Rails >= 6.0
|
14
|
+
* Rails >= 6.0
|
15
15
|
|
16
16
|
## Installation
|
17
17
|
|
18
18
|
Add to your application's Gemfile
|
19
19
|
|
20
20
|
```
|
21
|
-
gem 'undercarriage', '~> 0.
|
21
|
+
gem 'undercarriage', '~> 0.5'
|
22
22
|
```
|
23
23
|
|
24
24
|
Run the bundle command
|
@@ -40,10 +40,26 @@ TODO
|
|
40
40
|
Run tests with one of the following
|
41
41
|
|
42
42
|
```
|
43
|
-
$
|
43
|
+
$ bundle exec rspec
|
44
44
|
$ bundle exec rspec spec
|
45
45
|
```
|
46
46
|
|
47
|
+
### Appraisal
|
48
|
+
|
49
|
+
Undercarriage uses [Appraisal](https://github.com/thoughtbot/appraisal) to ensure various dependency versions work as expected
|
50
|
+
|
51
|
+
When dependencies change, run
|
52
|
+
|
53
|
+
```
|
54
|
+
$ bundle exec appraisal install
|
55
|
+
```
|
56
|
+
|
57
|
+
To run tests with Appraisal, run
|
58
|
+
|
59
|
+
```
|
60
|
+
$ bundle exec appraisal rspec
|
61
|
+
```
|
62
|
+
|
47
63
|
## Code Analysis
|
48
64
|
|
49
65
|
Various tools are used to ensure code is linted and formatted correctly.
|
@@ -41,16 +41,22 @@ module Undercarriage
|
|
41
41
|
def create
|
42
42
|
nested_resource_pre_build
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
respond_to do |format|
|
45
|
+
if @create_resource.save
|
46
|
+
after_create_action
|
46
47
|
|
47
|
-
|
48
|
+
format.html do
|
49
|
+
flash[flash_status_type] = flash_created_message
|
48
50
|
|
49
|
-
|
50
|
-
|
51
|
-
|
51
|
+
redirect_to location_after_create
|
52
|
+
end
|
53
|
+
format.json { render :show, status: :created, location: location_after_create }
|
54
|
+
else
|
55
|
+
nested_resource_build
|
52
56
|
|
53
|
-
|
57
|
+
format.html { render :new, status: :unprocessable_entity }
|
58
|
+
format.json { render json: @create_resource.errors, status: :unprocessable_entity }
|
59
|
+
end
|
54
60
|
end
|
55
61
|
end
|
56
62
|
|
@@ -41,9 +41,14 @@ module Undercarriage
|
|
41
41
|
def destroy
|
42
42
|
@destroy_resource.destroy
|
43
43
|
|
44
|
-
|
44
|
+
respond_to do |format|
|
45
|
+
format.html do
|
46
|
+
flash[flash_status_type] = flash_destroyed_message
|
45
47
|
|
46
|
-
|
48
|
+
redirect_to location_after_destroy
|
49
|
+
end
|
50
|
+
format.json { head :no_content }
|
51
|
+
end
|
47
52
|
end
|
48
53
|
|
49
54
|
protected
|
@@ -41,16 +41,22 @@ module Undercarriage
|
|
41
41
|
def update
|
42
42
|
nested_resource_pre_build
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
respond_to do |format|
|
45
|
+
if @update_resource.update(update_resource_params)
|
46
|
+
after_update_action
|
46
47
|
|
47
|
-
|
48
|
+
format.html do
|
49
|
+
flash[flash_status_type] = flash_updated_message
|
48
50
|
|
49
|
-
|
50
|
-
|
51
|
-
|
51
|
+
redirect_to location_after_update
|
52
|
+
end
|
53
|
+
format.json { render :show, status: :ok, location: location_after_update }
|
54
|
+
else
|
55
|
+
nested_resource_build
|
52
56
|
|
53
|
-
|
57
|
+
format.html { render :edit }
|
58
|
+
format.json { render json: @post.errors, status: :unprocessable_entity }
|
59
|
+
end
|
54
60
|
end
|
55
61
|
end
|
56
62
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: undercarriage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Freerksen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.0
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.0
|
26
|
+
version: '6.0'
|
27
27
|
description: Undercarriage is a set of concerns to add to your application to trim
|
28
28
|
some of the fat from controllers and models.
|
29
29
|
email:
|