mini_defender 0.3.12 → 0.3.14

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: e25d95f9b828e295edcfb4adea502ba8e550a097fe9f89238b37a7f281bb0ff0
4
- data.tar.gz: 9ea7aa549e7f45bab5c1575ec9290d695459f4afdcc322608516289bb138f969
3
+ metadata.gz: 3f4bd21f8f4dcb876d1a925f4e7085ef98dfcbed4617c74c03e4397f8e82fdf7
4
+ data.tar.gz: 9468125261910912a6e3934852e9045542fddf0c160bb8799cbb1bb14af02b4f
5
5
  SHA512:
6
- metadata.gz: f357991f889391a814f0704f811bdf31c31282f0363c28b18bfd55e183fecaa712a6771114cc5d78be7c82db282ad56bfa73a21c4b97f2e27b0c392acbf2bb25
7
- data.tar.gz: fedb66dacbc996e7401de58f8c2bd3192bae6f4605b5d4a9a62e04b8f4e514609d800f36da9e9daa16c6b323e9893186676d78196bc1d737fddff2e032f210ba
6
+ metadata.gz: b21ab061c620d5b3548cc50910511391d5ba5121f40338be876a00d09900904d41f04cd8c23fea1ea28a493f24c77dd19598499e10ef6f7169ffc3773037aeca
7
+ data.tar.gz: f07bd0c875a71679046e76ebcce28d878b47a942112a8c4a184bc9a10f1406459c8c1e17b72dc175c86df24ed59848fcf045dc67099c86b633b6c27e6aa87ae8
@@ -10,13 +10,17 @@ module MiniDefender::HandlesValidationErrors
10
10
  private
11
11
 
12
12
  def handle_validation_error(error)
13
+ unless self.respond_to?(:respond_to)
14
+ return render json: { message: error.message, errors: error.errors }, status: :unprocessable_entity
15
+ end
16
+
13
17
  respond_to do |format|
14
18
  format.html do
15
19
  flash[:error] = error.message
16
20
  flash[:validation_errors] = error.errors
17
21
  flash[:old_values] = safe_values
18
22
 
19
- redirect_back fallback_location: root_path
23
+ redirect_back fallback_location: '/'
20
24
  end
21
25
 
22
26
  format.json do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniDefender
4
- VERSION = "0.3.12"
4
+ VERSION = "0.3.14"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_defender
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ali Alhoshaiyan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-14 00:00:00.000000000 Z
11
+ date: 2023-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport