rails-rapido 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa0fe7fb2cd2c76eaf9268588f5a0b2019ef80bf
4
- data.tar.gz: 92f2a06fbbc4ebdbd1a66482bfe765cf14deee91
3
+ metadata.gz: 3a056bb244867b2d2970ada94d0085a94ac82f28
4
+ data.tar.gz: 4408b3b402c5dc2e3a9f4d3e84a0296eeb8b629c
5
5
  SHA512:
6
- metadata.gz: 73b11fbd42a02eb8ce2a1dd082e792098c74846614f724f87aaea04ca2431997dd67ae4fe92a1237e70baea79623c2717fc202627e288550a24be4833eb801df
7
- data.tar.gz: 83f56e6e634dfd905dd7246fc2219e5c51ec7a5948277f6fe80657b8aa0d4931158baf61a3a5799a941314194fa1a9f5ebae0cb225c877c392c903ca06341371
6
+ metadata.gz: d0aaec6064ddfe0b16a378ff11a6d69fa9b54ab36c7dc7ebc43234e95523fb52a0042b8fafe4b6d6fbe35b55451da4a7de1bd446c32872a626045bcd3f9dffa3
7
+ data.tar.gz: a58920ce0a110085221819f8546f3c95e8a9b02528e2594c96256f963a1310d5315af218e4f8a72e1d85a02db4e0ede36c59c49cf00feb47557797c1d76383b9
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Code Climate](https://codeclimate.com/github/starfighterheavy/rapido/badges/gpa.svg)](https://codeclimate.com/github/starfighterheavy/rapido)
4
4
  [![Dependency Status](https://gemnasium.com/starfighterheavy/rapido.svg)](https://gemnasium.com/starfighterheavy/rapido)
5
- [![Gem Version](https://badge.fury.io/rb/rapido.svg)](https://badge.fury.io/rb/rapido)
6
5
 
7
6
  Rapido is a simple, highly opinionated library that can be included into your Rails controllers to enforce standardized behavior and security.
8
7
 
@@ -3,13 +3,11 @@ h2= [@owner&.name, @resource_class.name.capitalize.pluralize].compact.join(" ")
3
3
  table
4
4
  thead
5
5
  tr
6
- - @resource_class.new.to_h.keys.each do |key|
6
+ - @resource_permitted_params.each do |key|
7
7
  th= key.to_s.capitalize
8
8
  - @resource_collection.each do |resource|
9
9
  tr
10
- - resource.keys.each_with_index do |key, index|
11
- - if index == 0
12
- td= link_to resource.name, url_for([@owner, resource].compact)
13
- - else
14
- - next if resource.name == resource[key]
15
- td= resource[key]
10
+ td= link_to resource.name, url_for([@owner, resource].compact)
11
+ - @resource_permitted_params.each do |key|
12
+ - next if key == "name"
13
+ td= resource[key]
@@ -42,7 +42,8 @@ module Rapido
42
42
  unless resource.destroy
43
43
  flash[:error] = resource.errors.full_messages.join('. ')
44
44
  end
45
- redirect_to after_delete_path(resource)
45
+ after_destroy_success(resource)
46
+ redirect_to after_delete_path(resource) unless performed?
46
47
  end
47
48
 
48
49
  def edit
@@ -76,6 +77,9 @@ module Rapido
76
77
  def after_update_failure(*)
77
78
  end
78
79
 
80
+ def after_destroy_success(*)
81
+ end
82
+
79
83
  def resource_path(action, resource = nil)
80
84
  keys = { controller: params[:controller], action: action }
81
85
  keys[resource_lookup_param] = resource.send(resource_lookup_param) if resource
@@ -1,3 +1,3 @@
1
1
  module Rapido
2
- VERSION = '0.3.8'
2
+ VERSION = '0.3.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-rapido
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Kirst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-14 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kaminari