effective_resources 2.2.4 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af933d56ed2a8a49c9b05dfee64b5a8e7a13d84358c54966208507f1703090ec
4
- data.tar.gz: dd28e88602d3c2d9f4b908d79260b2849d34cbdd3c8b6c204a18c96c2ad2d217
3
+ metadata.gz: 146cdb78cb556ab64e1dc464ad8670179f45d20b6aa4c89584d8a96dbd573517
4
+ data.tar.gz: e00c2763329776a6e06b95aa70fc7da7405baa7c11c4f77889d3f44fae8a3cf7
5
5
  SHA512:
6
- metadata.gz: a46d1580c41d7597766cea58782d0e7c4092aca90210049b5155d9b0330c3b5ed01cb8f24d8ab299bc12fcdec13a3b9f79fb8e4959e4cb3b38af1a1d407164a2
7
- data.tar.gz: a422ebe046792b4f000918c86a0df61e9884f276dbb5d580cce8ac02fb090186552cc25ae3da26682775460ef84a9da7a7296e2260e9e02c1a5ccec7d5960e0f
6
+ metadata.gz: 1b83b25e3291c35839e59637e4f79f83bd2e3e8cc998ba91f50ec30bccd814a0eb90f713c8de8c1367b17fc5aa0080020e07cf88893afa7ca9528724e1e56320
7
+ data.tar.gz: '05845a45e1650fef9da050660183138f2e23fa7e255942e8c70a01b3ee413fe19624465dabab515477c9f093d5414fc10c949f6f87c3ee2edd6f5e0b4ef3634f'
@@ -280,7 +280,7 @@ module EffectiveResourcesHelper
280
280
  end
281
281
 
282
282
  content_tag(:div, class: 'card') do
283
- content_tag(:div, class: 'card-body yo') do
283
+ content_tag(:div, class: 'card-body') do
284
284
  content_tag(:div, class: 'row') do
285
285
  content_tag(:div, class: 'col-sm') do
286
286
  content_tag(:h5, title, class: 'card-title')
@@ -2,12 +2,17 @@
2
2
 
3
3
  module EffectiveResourcesWizardHelper
4
4
 
5
- def render_wizard_sidebar(resource, numbers: true, horizontal: false, &block)
5
+ def render_wizard_sidebar(resource, numbers: true, path: nil, horizontal: false, &block)
6
+ if path.present?
7
+ raise('expected path to be a string with /build/ in it ') unless path.to_s.include?('/build/')
8
+ path = path.split('/build/').first + '/build/'
9
+ end
10
+
6
11
  klasses = ['wizard-sidebar', 'list-group', ('list-group-horizontal' if horizontal)].compact.join(' ')
7
12
 
8
13
  sidebar = content_tag(:div, class: klasses) do
9
14
  resource.sidebar_steps.map.with_index do |nav_step, index|
10
- render_wizard_sidebar_item(resource, nav_step, (index + 1 if numbers))
15
+ render_wizard_sidebar_item(resource, nav_step: nav_step, index: (index + 1 if numbers), path: (path + nav_step.to_s if path))
11
16
  end.join.html_safe
12
17
  end
13
18
 
@@ -19,7 +24,7 @@ module EffectiveResourcesWizardHelper
19
24
  end
20
25
  end
21
26
 
22
- def render_wizard_sidebar_item(resource, nav_step, index = nil)
27
+ def render_wizard_sidebar_item(resource, nav_step:, path: nil, index: nil)
23
28
  # From Controller
24
29
  current = (nav_step == step)
25
30
  title = resource_wizard_step_title(resource, nav_step)
@@ -33,7 +38,7 @@ module EffectiveResourcesWizardHelper
33
38
  if (current || disabled)
34
39
  content_tag(:a, label, class: klass)
35
40
  else
36
- link_to(label, wizard_path(nav_step), class: klass)
41
+ link_to(label, path || wizard_path(nav_step), class: klass)
37
42
  end
38
43
  end
39
44
 
@@ -305,12 +305,7 @@ module Effective
305
305
  end
306
306
  )
307
307
 
308
- if joined
309
- relation.where("#{sql_column} >= ? AND #{sql_column} <= ?", term, end_at)
310
- else
311
- relation.where(attribute.gteq(term)).where(attribute.lteq(end_at))
312
- end
313
-
308
+ relation.where("#{sql_column} >= ? AND #{sql_column} <= ?", term, end_at)
314
309
  end
315
310
 
316
311
  when :effective_obfuscation
@@ -334,11 +329,11 @@ module Effective
334
329
  return searched if searched
335
330
 
336
331
  # Simple operation search
332
+ # The Arel operator eq and matches bug out with serialized Array columns. So we avoid for datatables usage.
333
+
337
334
  case operation
338
- when :eq then
339
- joined ? relation.where("#{sql_column} = ?", term) : relation.where(attribute.eq(term))
340
- when :matches then
341
- joined ? relation.where("#{sql_column} #{ilike} ?", "%#{term}%") : relation.where(attribute.matches("%#{term}%"))
335
+ when :eq then relation.where("#{sql_column} = ?", term)
336
+ when :matches then relation.where("#{sql_column} #{ilike} ?", "%#{term}%")
342
337
  when :not_eq then relation.where(attribute.not_eq(term))
343
338
  when :does_not_match then relation.where(attribute.does_not_match("%#{term}%"))
344
339
  when :starts_with then relation.where(attribute.matches("#{term}%"))
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.2.4'.freeze
2
+ VERSION = '2.2.6'.freeze
3
3
  end
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.2.4
4
+ version: 2.2.6
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: 2023-01-09 00:00:00.000000000 Z
11
+ date: 2023-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails