base_editing_bootstrap 0.4.2 → 0.5.0

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: 77c13adc91ffb0336f044c8679f8594896f0488217c2a794440346f950cb13c1
4
- data.tar.gz: c41c9312226e37ff2f244612abe2168e3aecf9bd6cadc79015faa1939e3f7eeb
3
+ metadata.gz: ba7128b63918eeebe5d2615895fccdfb352a01522d789b563c76c32bb48cf2a8
4
+ data.tar.gz: 8a131d2ba99e266f7ac0b92e4b993e791508141f46dbecb8b228a296bd5a6fc1
5
5
  SHA512:
6
- metadata.gz: 4bda28795ec6bb33c7dcfc043f51da88c54b4055b014f223d0ccad0d2d5ba72423db87134f08317f2b6153da9bc0c5713ded3772a4949b0f165285c2aae3cf1b
7
- data.tar.gz: 6ef88c451560bf050e497c559f19bc1e96cf87b02e83b5fe6dd42010e3baea5e30f94e6ceac57963eb89d7ce16d21a2e88e6358a80bcf8237fe8e04558324e39
6
+ metadata.gz: 61af8c0e0f59c866de6216d054b6d143935ead13eae8a47287b24f9b6efa2103ce29d6684c91cf9668996ade6fa6303fbd623d7828a6587e23571e8b64f0e0c8
7
+ data.tar.gz: 3d1495bcf1b375514dd1fe010de6135e4ca68957b22e5c051aeae3871f7025996c5d75400919c1e9c0e53b01ec8799ed3067a0efc2154e7bab1f7ef6b9e0dc44
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
  All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
3
3
 
4
4
  - - -
5
+ ## 0.5.0 - 2024-05-22
6
+ #### Bug Fixes
7
+ - Correct initializer commented examples - (ba90fba) - Marino Bonetti
8
+ #### Features
9
+ - Action for Show enabled - (d364ed3) - Marino Bonetti
10
+ - Enums with Integer identified - (4fa9e87) - Marino Bonetti
11
+ #### Tests
12
+ - Save example_status_persistence_file_path - (235939d) - Marino Bonetti
13
+
14
+ - - -
15
+
5
16
  ## 0.4.2 - 2024-05-08
6
17
  #### Bug Fixes
7
18
  - Rename shared example for cluck with apps - (41638f8) - Marino Bonetti
@@ -1,5 +1,5 @@
1
1
  class BaseEditingController < RestrictedAreaController
2
- before_action :load_object, only: [:edit, :update, :destroy]
2
+ before_action :load_object, only: [:edit, :show, :update, :destroy]
3
3
  helper_method :base_class,
4
4
  :destroy_custom_polymorphic_path,
5
5
  :edit_custom_polymorphic_path,
@@ -32,6 +32,10 @@ class BaseEditingController < RestrictedAreaController
32
32
  @object = yield(@object) if block_given?
33
33
  end
34
34
 
35
+ def show
36
+ @object = yield(@object) if block_given?
37
+ end
38
+
35
39
  def update
36
40
  @object = yield(@object) if block_given?
37
41
  respond_to do |format|
@@ -18,23 +18,23 @@ module Utilities
18
18
  # @param [Symbol] field
19
19
  def form_print_field(form, field)
20
20
  locals = {form:, field:}
21
- type = form.object.class.type_for_attribute(field).type
22
- case type
23
- when :datetime
24
- generic_field = "datetime"
25
- when :date
26
- generic_field = "date"
27
- when :decimal
28
- locals[:scale] = form.object.class.type_for_attribute(field).scale || 2
29
- generic_field = "decimal"
30
- when :float
31
- locals[:scale] = 2 # usiamo il default dato che non abbiamo questa informazione negli attributes di rails
32
- generic_field = "decimal"
33
- when :integer
34
- generic_field = "integer"
21
+ if form.object.class.defined_enums.key?(field.to_s)
22
+ generic_field = "enum"
35
23
  else
36
- if form.object.class.defined_enums.key?(field.to_s)
37
- generic_field = "enum"
24
+ type = form.object.class.type_for_attribute(field).type
25
+ case type
26
+ when :datetime
27
+ generic_field = "datetime"
28
+ when :date
29
+ generic_field = "date"
30
+ when :decimal
31
+ locals[:scale] = form.object.class.type_for_attribute(field).scale || 2
32
+ generic_field = "decimal"
33
+ when :float
34
+ locals[:scale] = 2 # usiamo il default dato che non abbiamo questa informazione negli attributes di rails
35
+ generic_field = "decimal"
36
+ when :integer
37
+ generic_field = "integer"
38
38
  else
39
39
  generic_field = "base"
40
40
  end
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.5.0
@@ -5,18 +5,18 @@ BaseEditingBootstrap.configure do |config|
5
5
  # Controller da cui derivare poi il BaseEditingController da cui derivano
6
6
  # tutti i controller sottostanti
7
7
  # @default "ApplicationController"
8
- # config_accessor :inherited_controller, default: "ApplicationController"
8
+ # config.inherited_controller = "ApplicationController"
9
9
 
10
10
  ##
11
11
  # Configurazione per alterare lo standard di azione post aggiornamento record
12
12
  # il default è andare nella pagina di editing del record
13
13
  # possibili valori :edit , :index
14
- # config_accessor :after_success_update_redirect, default: :edit
14
+ # config.inherited_controller = :edit
15
15
 
16
16
  ##
17
17
  # Configurazione per alterare lo standard di azione post creazione record
18
18
  # il default è andare nella pagina di editing del record
19
19
  # possibili valori :edit , :index
20
- # config_accessor :after_success_create_redirect, default: :edit
20
+ # config.inherited_controller = :edit
21
21
 
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base_editing_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino Bonetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-08 00:00:00.000000000 Z
11
+ date: 2024-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails