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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49408b391bddf7ba9ac46cabb0bf0120a6397347a0fcd4d699c62fb09b9e6e9b
4
- data.tar.gz: 2ed338bad62fb5cd9e0c176aa79283a8ac57c866a7ee779343dc5da77b21eed8
3
+ metadata.gz: f945fc6fc7363b04f3922b55b2670a33ad219aafc78766b01ec5a57a95937673
4
+ data.tar.gz: e8dacda120b63acb3958178d4f1cef27740af4b83cbfad705a30a937e588eab1
5
5
  SHA512:
6
- metadata.gz: 7e57fb23966732a30240c7d150b5f4cb4c95d22c7f6d6c293ea18d895d5c7b727fc12bb9db22447874ab54a82f08c2a006a3517eaae25b2aef7373cc125c263c
7
- data.tar.gz: 214c87931becd6819744f65b6c6df677ebb8092e226dcd544a8f2c564c451502c656e42cc8f8c870902ece1719d9f91bdf7836ef786dbb9f1b6b0ab762785f3c
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
- rate_limit to: 10, within: 1.hour, by: -> { current_user&.id }, only: :show, if: -> { step&.to_sym == :checkout }
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.35.4'.freeze
2
+ VERSION = '2.36.0'.freeze
3
3
  end
@@ -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.35.4
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-13 00:00:00.000000000 Z
11
+ date: 2026-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails