formify 0.23.7 → 0.23.8

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: 62c0e47b4cfc7c10abfd87ec1ed66646acda42c83ccf7b1cbf104e6677ac32cf
4
- data.tar.gz: f11c13dfc2d661d076c546f13a4dc41fcf9944837994f14a47861b5658e71a7f
3
+ metadata.gz: 015ab62d01b20c23212fe36b9888938af1a107990dd29ba1ae39fd66947b2d8e
4
+ data.tar.gz: 8f65bd50586e9361b4ef45125f040616f2de8d0996d2c5d406b8c548544d939f
5
5
  SHA512:
6
- metadata.gz: 85e4cb00e546956b34ff6d79ed035baf0a06b243a8ee74f9e5e9655978688d7fe5a7f0c8085cba3a384ee6b51b154fdad54c1b486148233db576b36b84f90f64
7
- data.tar.gz: ca48cadd7c79cfc5783a5a20a2bc888f2f4110f4d6eee209bc55ddfd14ff800d5255bfe73efceafc59fe994a031d7967ef0b52800aaefe007cc26eebb998ab97
6
+ metadata.gz: 53deab0c2b64cc4b1acf1ad3279c0e3043cdbccbd0125e938a59f123017a2f2c375cc496e6d9dcc0d62b4c7bd1ece37260c20548cce30abf72c76de1c4ec48da
7
+ data.tar.gz: 0a3806cbd9c870c33d5e88ac8063e79b320e0db4ce5b502e6cfc7b454b6a3e7e81af20175627818fe9f115d5168204ac8aba0f3009357da27104949842692213
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- formify (0.23.7)
4
+ formify (0.23.8)
5
5
  rails
6
6
  resonad
7
7
  with_advisory_lock
@@ -157,7 +157,7 @@ GEM
157
157
  thor (0.20.3)
158
158
  thread_safe (0.3.6)
159
159
  tins (1.20.3)
160
- tzinfo (1.2.6)
160
+ tzinfo (1.2.7)
161
161
  thread_safe (~> 0.1)
162
162
  websocket-driver (0.7.1)
163
163
  websocket-extensions (>= 0.1.0)
@@ -5,6 +5,10 @@ module Formify
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
+ def formify_flash_keys
9
+ @formify_flash_keys ||= %i[danger info success]
10
+ end
11
+
8
12
  def formify_params(root, *permitted)
9
13
  params
10
14
  .permit(
@@ -12,17 +16,17 @@ module Formify
12
16
  )[root]
13
17
  end
14
18
 
15
- def redirect_to_with_flash(*args, **keywords)
16
- keywords.slice(%i[danger info success]).each do |k, v|
19
+ def formify_redirect_to_with_flash(*args, **keywords)
20
+ keywords.slice(flash_keys).each do |k, v|
17
21
  flash[k] = v
18
22
  end
19
23
 
20
24
  Rails.logger.info "Redirecting to: #{args.first}"
21
25
 
22
- super(*args, **keywords)
26
+ redirect_to(*args, **keywords.except(formify_flash_keys))
23
27
  end
24
28
 
25
- def render_form_result(form:, on_failure: nil, on_success: nil, result:)
29
+ def formify_render_form_result(form:, on_failure: nil, on_success: nil, result:)
26
30
  if result.success?
27
31
  if form.translation_success.present?
28
32
  flash[:success] = form.translation_success
@@ -39,8 +43,8 @@ module Formify
39
43
  yield(result) if block_given?
40
44
  end
41
45
 
42
- def save_and_render_form(form:, on_failure: nil, on_success: nil, &block)
43
- render_form_result(
46
+ def formify_save_and_render_form(form:, on_failure: nil, on_success: nil, &block)
47
+ formify_render_form_result(
44
48
  form: form,
45
49
  on_failure: on_failure,
46
50
  on_success: on_success,
@@ -1,3 +1,3 @@
1
1
  module Formify
2
- VERSION = '0.23.7'.freeze
2
+ VERSION = '0.23.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.7
4
+ version: 0.23.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Jackson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-02 00:00:00.000000000 Z
11
+ date: 2020-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler