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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b12f7949572ff816f2b669ca0a6d94bfe8bce39ba6a744092b16ceedfda4cdac
4
- data.tar.gz: 651b54c29ed119c043ca0542dccadfc7e6f60ffd471d86cbe1988c7f377d7c90
3
+ metadata.gz: 2a9348f83d9d2e3924e13edfcb27bcea2a7602479195298e5f9e95ce646e8cb2
4
+ data.tar.gz: 2f6fe5126d7b6d4db2429118dc9343f30c76609766d313937cf26790cf5ad7e8
5
5
  SHA512:
6
- metadata.gz: de197de22b4c1cada28489687edeea986d628a7dc3245932e0b33565e9a4061c74dea37b7f5981e24e4348262d22d8df1df026b204edb008c86665299098b8fc
7
- data.tar.gz: da32a07d87b9eccfc756de524410800fc36fa1b63814bb1ea5defa95bf870f854824c98ccae3fc3f8dbbd0192bb97f56e9a3f7921e5448a9a90746dd06ef7e81
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.3
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.4'
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
- $ bin/test
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
- if @create_resource.save
45
- after_create_action
44
+ respond_to do |format|
45
+ if @create_resource.save
46
+ after_create_action
46
47
 
47
- flash[flash_status_type] = flash_created_message
48
+ format.html do
49
+ flash[flash_status_type] = flash_created_message
48
50
 
49
- redirect_to location_after_create
50
- else
51
- nested_resource_build
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
- render :new, status: :unprocessable_entity
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
- flash[flash_status_type] = flash_destroyed_message
44
+ respond_to do |format|
45
+ format.html do
46
+ flash[flash_status_type] = flash_destroyed_message
45
47
 
46
- redirect_to location_after_destroy
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
- if @update_resource.update(update_resource_params)
45
- after_update_action
44
+ respond_to do |format|
45
+ if @update_resource.update(update_resource_params)
46
+ after_update_action
46
47
 
47
- flash[flash_status_type] = flash_updated_message
48
+ format.html do
49
+ flash[flash_status_type] = flash_updated_message
48
50
 
49
- redirect_to location_after_update
50
- else
51
- nested_resource_build
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
- render :edit, status: :unprocessable_entity
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
 
@@ -4,5 +4,5 @@ module Undercarriage
4
4
  ##
5
5
  # Undercarriage version
6
6
  #
7
- VERSION = '0.4.1'
7
+ VERSION = '0.5.0'
8
8
  end
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.1
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-12 00:00:00.000000000 Z
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.3
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.3
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: