pg_rails 7.6.24.pre.3 → 7.6.24.pre.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df69f78931ad3bcdb9f27c97fec266fbe3ced8bc15ab1023e78fee58215ac81e
|
4
|
+
data.tar.gz: b1dba4fa0dfc0807d2c957550ed88ebac3195d90d9c3a027b6742bb04ffdbc6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6425deb0c9948195fe9a4c01050ff20755569d4032859d546b61f49571dd4adf710f030eac01ffcc0c4e630f0104da5e5b3fbdbc93f6567dbbc30d2973221837
|
7
|
+
data.tar.gz: 4b341a08115173a6344332ae8a16bb8b913773e14e460c32b70db375e9af07006395ae552be5d0d971bd8e25b1757e6878c48e5c81e1e78c045c0e69ee95d599
|
@@ -9,20 +9,16 @@ module PgEngine
|
|
9
9
|
end
|
10
10
|
|
11
11
|
SUFIJOS = %i[f text].freeze
|
12
|
-
def unsuffixed(attribute
|
12
|
+
def unsuffixed(attribute)
|
13
13
|
ret = attribute.to_s.dup
|
14
14
|
|
15
|
-
|
15
|
+
SUFIJOS.each do |sufijo|
|
16
16
|
ret.gsub!(/_#{sufijo}$/, '')
|
17
17
|
end
|
18
18
|
|
19
19
|
ret
|
20
20
|
end
|
21
21
|
|
22
|
-
def unsuffixed_for_export(attribute)
|
23
|
-
unsuffixed(attribute, %i[f])
|
24
|
-
end
|
25
|
-
|
26
22
|
def encabezado(input, options = {})
|
27
23
|
if input.is_a? Array
|
28
24
|
campo = unsuffixed(input.first)
|
@@ -14,7 +14,11 @@ wb.add_worksheet(name: @clase_modelo.nombre_plural) do |sheet|
|
|
14
14
|
|
15
15
|
@collection.decorate.each do |object|
|
16
16
|
array = atributos_para_listar.map do |att, _sort_by|
|
17
|
-
|
17
|
+
field = unsuffixed(att)
|
18
|
+
if object.respond_to?(:"#{field}_text")
|
19
|
+
field = :"#{field}_text"
|
20
|
+
end
|
21
|
+
object.send(field)
|
18
22
|
end
|
19
23
|
array.append object.to_key
|
20
24
|
sheet.add_row array
|
data/pg_rails/lib/version.rb
CHANGED