effective_resources 2.7.9 → 2.7.11
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d337f18fe69722ae972a31d8027af508b555b6542496e626d7793dacec6f2a17
|
4
|
+
data.tar.gz: 44cb8d6fce0394a2dee68cd4731e3aea349d9edf2a8eed46026afe26e76838a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45c1f94eba3ba91769fb8b6e356333405e2dd826e6ab14657abe7feaeec9635ce05f75554929ac140ad295d3759180dd04aa208adfe67bae6fcb8d70ee5a489c
|
7
|
+
data.tar.gz: a324bf7e82198921d34b19f341c8e36bb72ff4225dd7b9bbd6b94d4e30cf6d8aa131fc69700c6da6fc4d2ceb45efd784e9bcf50d64f2d095d526c6c672591416
|
@@ -206,7 +206,7 @@ module EffectiveResourcesHelper
|
|
206
206
|
end
|
207
207
|
alias_method :render_resource, :render_resource_partial
|
208
208
|
|
209
|
-
def
|
209
|
+
def render_partial_exists?(partial, atts = {})
|
210
210
|
raise('expected a path') unless partial.kind_of?(String)
|
211
211
|
raise('path should not include spaces') if partial.include?(' ')
|
212
212
|
|
@@ -215,12 +215,11 @@ module EffectiveResourcesHelper
|
|
215
215
|
file = pieces.last
|
216
216
|
path = pieces[0..-2].join('/')
|
217
217
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
end
|
218
|
+
lookup_context.exists?(file, [path], :partial)
|
219
|
+
end
|
220
|
+
|
221
|
+
def render_if_exists(partial, atts = {})
|
222
|
+
render(partial, atts) if render_partial_exists?(partial, atts)
|
224
223
|
end
|
225
224
|
|
226
225
|
# Tableize attributes
|
@@ -350,6 +350,13 @@ module Effective
|
|
350
350
|
when :gteq then relation.where(attribute.gteq(term))
|
351
351
|
when :lt then relation.where(attribute.lt(term))
|
352
352
|
when :lteq then relation.where(attribute.lteq(term))
|
353
|
+
when :days_ago_eq
|
354
|
+
date = (Time.zone.now - (term.to_i).days)
|
355
|
+
relation.where("#{sql_column} >= ? AND #{sql_column} <= ?", date.beginning_of_day, date.end_of_day)
|
356
|
+
when :days_ago_lteq # 30 days or less ago.
|
357
|
+
relation.where("#{sql_column} >= ?", Time.zone.now - (term.to_i).days)
|
358
|
+
when :days_ago_gteq # 30 days or more ago
|
359
|
+
relation.where("#{sql_column} <= ?", Time.zone.now - (term.to_i).days)
|
353
360
|
else raise("Unexpected operation: #{operation}")
|
354
361
|
end
|
355
362
|
end
|
@@ -1,3 +1,11 @@
|
|
1
1
|
= wizard_card(resource) do
|
2
|
-
=
|
3
|
-
|
2
|
+
- partial = "#{resource.render_path}/#{resource.render_step}_fields"
|
3
|
+
|
4
|
+
- if render_partial_exists?(partial)
|
5
|
+
= effective_table_with(resource) { |f| render(partial, f: f) }
|
6
|
+
|
7
|
+
- elsif Rails.env.development? || Rails.env.test?
|
8
|
+
- names = partial.split('/')
|
9
|
+
- name = names[0...-1].join('/') + '/_' + names.last + '.html.haml'
|
10
|
+
|
11
|
+
%div.alert.alert-warning Unable to find partial: #{name}
|
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.7.
|
4
|
+
version: 2.7.11
|
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-05-
|
11
|
+
date: 2023-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|