rails-sweetalert2-confirm 0.9.5 → 0.9.6

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
  SHA1:
3
- metadata.gz: dd16665f4747d5ba63d484e14233a8b780ab8b06
4
- data.tar.gz: 6688a931595c4f91dce4de7d5180f27c371e5f7b
3
+ metadata.gz: bb1cb50891fbc5806dcc01b28961938e6c657001
4
+ data.tar.gz: fed487b24022ceca7e05cd404c1319d479307c86
5
5
  SHA512:
6
- metadata.gz: bb4eec7955ab8e4613d2b631782d25f53544c6a7ff00e9ec6316a9ab8b35a883e9dc0bf31a0f190e712202b166c330b3db1fd532853fde4bb1ba451e4bbc1b60
7
- data.tar.gz: 1cd75ec42ec9fd0839b687b1d0f7968d77588d60d131ba1cee975f32fdc99c3c287d917c516ff9162c2b0b6e410e9e74f3a92b93b82377ecc783c2f0ee4e73c1
6
+ metadata.gz: 84c73951440193557eb66a650496210d49e520fe093435b4ee020e462f276ff457fa8d826397f3900a2b6aff2432b30701172c8725bbca295f940639a11e6b44
7
+ data.tar.gz: 249596f89c47626903cabba4e56151661822e4d2915a1c022e7630e3883d373287dbb29af49d93ffd2e95e5d87ff86497bd705e1b8aec8c444cfcd397bcc4ebc
@@ -116,6 +116,7 @@ var sweetAlertConfirm = function(event) {
116
116
  "input_class":"inputClass",
117
117
  "on_open":"onOpen",
118
118
  "on_close":"onClose",
119
+ "method":"method"
119
120
  };
120
121
 
121
122
  function afterConfirmCallback() {
@@ -1,3 +1,3 @@
1
1
  module RailsSweetAlert2Confirm
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
@@ -1,7 +1,8 @@
1
1
  module RailsSweetAlert2Confirm
2
2
  SWAL_OPTIONS_MAPPINGS = {
3
3
  confirm: :title,
4
- remote: :remote
4
+ remote: :remote,
5
+ method: :method
5
6
  }
6
7
 
7
8
  module ViewHelpers
@@ -26,7 +27,8 @@ module RailsSweetAlert2Confirm
26
27
 
27
28
  def merge_options_into_swal(options)
28
29
  options = merge_confirm_into_swal(options)
29
- merge_remote_into_swal(options)
30
+ options = merge_remote_into_swal(options)
31
+ merge_method_into_swal(options)
30
32
  end
31
33
 
32
34
  %w(confirm remote method).each do |option|
@@ -36,20 +38,17 @@ module RailsSweetAlert2Confirm
36
38
  options[:data][:swal] ||= {}
37
39
  option = option.to_sym
38
40
  options[:data][:swal][SWAL_OPTIONS_MAPPINGS[option]] =
39
- send("retrieve_#{option}_from", options)
41
+ if option == :method
42
+ options[option] ||
43
+ options[:data][option]
44
+ else
45
+ options.delete(option) ||
46
+ options[:data].delete(option)
47
+ end
40
48
  end
41
49
  options
42
50
  end
43
51
 
44
- define_method("retrieve_#{option}_from") do |options|
45
- case option
46
- when "method"
47
- options[option] || options[:data][option]
48
- else
49
- options.delete(option) || options[:data].delete(option)
50
- end
51
- end
52
-
53
52
  define_method("options_has_#{option}?") do |options|
54
53
  option = option.to_sym
55
54
  (options[option] || options[:data].try(:[], option)).present?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-sweetalert2-confirm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Woodward