vario 1.0.7 → 1.0.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
  SHA256:
3
- metadata.gz: d05e19cb7867108b8418ed9d883f14426c739cd82bda85477c91a6b33ca1d071
4
- data.tar.gz: 8a3ec565a958f7d7abdb402583752c00300e265407c728e6274a09f10faa1a96
3
+ metadata.gz: 72dda152204470710230814ed7b164322aeeed9081a6d0a92474210ce184253e
4
+ data.tar.gz: e2d28169ff7af1e04a77d58139f0d39670c9122b6ee1659dd42b9a39c34d19be
5
5
  SHA512:
6
- metadata.gz: 6ac0aa3e19f7ef9cad8bcdfc972d1c9def674e0ed22f1c4ac86ffe49c2ea2ac2830a617407614c61cebc544f09bb777f8bc751966e59e5aab998fb3e1f305f9c
7
- data.tar.gz: ab052a42269f6cc92ebd80817fa50ef320742c44ce6791532924d002a7446966e270df4d3a20c0c6b0687484d07cb426131cf06c6e5ccca9e29014536fd5cf37
6
+ metadata.gz: c5f1ae8b6f91f32014784631fce9093e0e43126a6e7802047f2762689091decd73d79adaeefeee9e1e401346379d630aafdf28d8b64a0f945e8a70995bad64ba
7
+ data.tar.gz: f7bbfe84ef93f50fd63062ab48a1cb789a97911f799c365a190a80a4427ecf550d4cb4262e7db1f63b38cb3bb4a4afce3abce0e06dd7744a7d9442049adeeb91
@@ -12,12 +12,16 @@ module Vario
12
12
  @setting.levels.unshift @level
13
13
  @level.conditions = normalize_booleans(level_params[:conditions].to_h)
14
14
  @level.conditions = normalize_booleans(level_params[:conditions].to_h)
15
- @setting.save
16
- if request.referer.present? && URI.parse(request.referer).path != setting_path(@setting)
17
- redirect_to request.referer
15
+ if @setting.save
16
+ if request.referer.present? && URI.parse(request.referer).path != setting_path(@setting)
17
+ redirect_to request.referer
18
+ else
19
+ respond_with @setting, collection_location: -> { setting_path(@setting) }
20
+ end
18
21
  else
19
- respond_with @setting, collection_location: -> { setting_path(@setting) }
20
- end
22
+ Signum.error(current_user, text: @setting.errors.full_messages.join(","))
23
+ redirect_to setting_path(@setting)
24
+ end
21
25
  end
22
26
 
23
27
  def update
@@ -29,12 +33,16 @@ module Vario
29
33
  @level = @setting.levels.find { |level| level.id == params[:id] }
30
34
  @level.value = level_params[:value]
31
35
  @level.conditions = normalize_booleans(level_params[:conditions].to_h)
32
- @setting.save
33
- if request.referer.present? && URI.parse(request.referer).path != setting_path(@setting)
34
- redirect_to request.referer
36
+ if @setting.save
37
+ if request.referer.present? && URI.parse(request.referer).path != setting_path(@setting)
38
+ redirect_to request.referer
39
+ else
40
+ respond_with @setting, collection_location: -> { setting_path(@setting) }
41
+ end
35
42
  else
36
- respond_with @setting, collection_location: -> { setting_path(@setting) }
37
- end
43
+ Signum.error(current_user, text: @setting.errors.full_messages.join(","))
44
+ redirect_to setting_path(@setting)
45
+ end
38
46
  end
39
47
 
40
48
  def destroy
@@ -56,6 +64,10 @@ module Vario
56
64
  render json: { old: oldIndex, new: newIndex }
57
65
  end
58
66
 
67
+ def index; end
68
+
69
+ def show; end
70
+
59
71
  private
60
72
 
61
73
  def set_objects
@@ -37,7 +37,7 @@
37
37
  - when :integer
38
38
  = f.input :value, as: :number
39
39
  - when :boolean
40
- = f.input :value, as: :switch
40
+ = f.input :value, as: :switch, value: level.value || setting.default
41
41
  - when :text
42
42
  = f.input :value, as: :editor, mode: 'text/plain'
43
43
  - when :hash
data/lib/vario/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vario
4
- VERSION = "1.0.7"
4
+ VERSION = "1.0.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vario
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Meij
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-28 00:00:00.000000000 Z
11
+ date: 2026-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape