effective_resources 2.35.4 → 2.36.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 +4 -4
- data/app/controllers/concerns/effective/wizard_controller.rb +3 -1
- data/app/helpers/effective_resources_private_helper.rb +4 -4
- data/app/models/effective/resources/actions.rb +5 -0
- data/config/effective_resources.rb +8 -0
- data/lib/effective_resources/version.rb +1 -1
- data/lib/effective_resources.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f945fc6fc7363b04f3922b55b2670a33ad219aafc78766b01ec5a57a95937673
|
|
4
|
+
data.tar.gz: e8dacda120b63acb3958178d4f1cef27740af4b83cbfad705a30a937e588eab1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07236ca140bb49ec85af5d1b01a62d97b68ac34fba37964ac4a441954dd33ac2bc5caa1b33cd39261117779ee32a74b2c7dd6ca2546bfd4bb230e6663ca980fc
|
|
7
|
+
data.tar.gz: b7d3329368dccc9f1de0d2cbecfac601c93924b4378908b775ccf52aee5afb0759be98836547daa1cd02dfc47051ec10c4ef4ec4483e57689821b428b985a68e
|
|
@@ -40,7 +40,9 @@ module Effective
|
|
|
40
40
|
before_action :ready_checkout
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
unless Rails.env.development?
|
|
44
|
+
rate_limit to: 10, within: 1.hour, by: -> { current_user&.id }, only: :show, if: -> { step&.to_sym == :checkout }
|
|
45
|
+
end
|
|
44
46
|
|
|
45
47
|
helper_method :resource
|
|
46
48
|
helper_method :resource_wizard_step_title
|
|
@@ -51,13 +51,13 @@ module EffectiveResourcesPrivateHelper
|
|
|
51
51
|
# Assign class
|
|
52
52
|
opts[:class] ||= (
|
|
53
53
|
if opts['data-method'].to_s == 'delete'
|
|
54
|
-
'btn btn-danger'
|
|
54
|
+
EffectiveResources.delete_action_button_class || 'btn btn-danger'
|
|
55
55
|
elsif opts[:action] == :new
|
|
56
|
-
'btn btn-success'
|
|
56
|
+
EffectiveResources.new_action_button_class || 'btn btn-success'
|
|
57
57
|
elsif h.length == 0
|
|
58
|
-
'btn btn-primary'
|
|
58
|
+
EffectiveResources.action_button_class || 'btn btn-primary'
|
|
59
59
|
elsif defined?(EffectiveBootstrap)
|
|
60
|
-
'btn btn-secondary'
|
|
60
|
+
EffectiveResources.button_class || 'btn btn-secondary'
|
|
61
61
|
else
|
|
62
62
|
'btn btn-default'
|
|
63
63
|
end
|
|
@@ -119,6 +119,11 @@ module Effective
|
|
|
119
119
|
# Generate the path
|
|
120
120
|
path = (routes[action].format(formattable || EMPTY_HASH) rescue nil)
|
|
121
121
|
|
|
122
|
+
# Append default format from route (e.g., defaults: { format: :csv })
|
|
123
|
+
if path.present? && (default_format = routes[action].defaults[:format]).present?
|
|
124
|
+
path = "#{path}.#{default_format}"
|
|
125
|
+
end
|
|
126
|
+
|
|
122
127
|
if path.present? && opts.present?
|
|
123
128
|
uri = URI.parse(path)
|
|
124
129
|
uri.query = URI.encode_www_form(opts)
|
|
@@ -30,6 +30,14 @@ EffectiveResources.setup do |config|
|
|
|
30
30
|
# Supported values: 'Save', 'Continue', and 'Add New'
|
|
31
31
|
config.default_submits = ['Save', 'Continue', 'Add New']
|
|
32
32
|
|
|
33
|
+
# Default Button Classes
|
|
34
|
+
#
|
|
35
|
+
# These are the btn class on links generated by render_resource_buttons method
|
|
36
|
+
# config.action_button_class = 'btn btn-primary'
|
|
37
|
+
# config.new_action_button_class = 'btn btn-success'
|
|
38
|
+
# config.delete_action_button_class = 'btn btn-danger'
|
|
39
|
+
# config.button_class = 'btn btn-secondary'
|
|
40
|
+
|
|
33
41
|
# Mailer Settings
|
|
34
42
|
#
|
|
35
43
|
# The default mailer settings for all effective gems
|
data/lib/effective_resources.rb
CHANGED
|
@@ -12,7 +12,8 @@ module EffectiveResources
|
|
|
12
12
|
def self.config_keys
|
|
13
13
|
[
|
|
14
14
|
:authorization_method, :default_submits,
|
|
15
|
-
:parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject
|
|
15
|
+
:parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject,
|
|
16
|
+
:action_button_class, :new_action_button_class, :delete_action_button_class, :button_class
|
|
16
17
|
]
|
|
17
18
|
end
|
|
18
19
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: effective_resources
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.36.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Code and Effect
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|