effective_resources 0.10.0 → 0.10.1

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: 6b64a2a72a925cc6d0932a5a5f60d490fbf6ae54
4
- data.tar.gz: 65206626420879daa72dce237a217bc0193c8500
3
+ metadata.gz: 297715acf66f40c204bce59ebb58873f0499afaa
4
+ data.tar.gz: b9a0766cc92594a8f6f0cae06bfecd6aefdb24b5
5
5
  SHA512:
6
- metadata.gz: e7283195596e3b271a42c37708d6ffc916ca38e565e9e716fcef1bb5d67bb0311ff90b40a73c7c53c6e54d587b8344be7f224435d5d6166992e81d148fa4e9c5
7
- data.tar.gz: b28fdcca5a4eca2aeb83bff6d0100e31867a71a18eb7cd128081fc8b22a143a16a1f53c1d2a7020da4db9ceb835fc34fc970cf2d1ff39fab23fb91b0cd1f42cc
6
+ metadata.gz: baa1604c9325e9b8f0259ad4657dd209bc89e9a1dc9dfccdf106a1030f066d77a043896da6c430b19971c15d005bfba401d591c48b4f3057b552c9b83c7ae3d5
7
+ data.tar.gz: 68077fb078d34ad68d0a5122bcdc56fcddf567969d7a0bb432e8ac95cca6fde7aa56bd70f882c99456ddbe5e70106c9837e417fd0f1797f10ac5504efccce4b4
@@ -56,12 +56,12 @@ module Effective
56
56
  send(:instance_variable_set, "@#{resource_plural_name}", instance)
57
57
  end
58
58
 
59
- private
60
-
61
59
  def effective_resource
62
60
  @_effective_resource ||= self.class.effective_resource
63
61
  end
64
62
 
63
+ private
64
+
65
65
  def resource_name # 'thing'
66
66
  effective_resource.name
67
67
  end
@@ -17,13 +17,15 @@ module EffectiveResourcesHelper
17
17
  actions = (controller.respond_to?(:effective_resource) ? controller.class : find_effective_resource).submits
18
18
  actions = permitted_resource_actions(form.object, actions)
19
19
 
20
- submits = actions.map { |name, opts| form.button(:submit, name, opts.except(:action, :title, 'data-method', 'data-confirm')) }.join(' ').html_safe
20
+ submits = actions.map { |name, opts| form.button(:submit, name, opts.except(:action, :title, 'data-method', 'data-confirm')) }
21
21
 
22
22
  # I think this is a bug. I can't override default button class when passing my own class: variable. it merges them.
23
23
  if (btn_class = SimpleForm.button_class).present?
24
24
  submits = submits.map { |submit| submit.sub(btn_class, '') }
25
25
  end
26
26
 
27
+ submits = submits.join(' ').html_safe
28
+
27
29
  wrapper_options = { class: 'form-actions' }.merge(options.delete(:wrapper_html) || {})
28
30
 
29
31
  content_tag(:div, wrapper_options) do
@@ -18,7 +18,9 @@ module EffectiveResourcesPrivateHelper
18
18
  action = opts[:action]
19
19
 
20
20
  # Transform data: { ... } hash into 'data-' keys
21
- data.each { |k, v| opts["data-#{k}"] ||= v } if (data = opts.delete(:data))
21
+ if (data = opts.delete(:data))
22
+ data.each { |k, v| opts["data-#{k}"] ||= v }
23
+ end
22
24
 
23
25
  # Assign data method and confirm
24
26
  if effective_resource.member_post_actions.include?(action)
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '0.10.0'.freeze
2
+ VERSION = '0.10.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect