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: 515caff33953b3d9a058e092be6152c0e9da6ca0fe740075c5fca7833bc39644
4
- data.tar.gz: 4ed2e3e33a0c6d39461c20f7a616c04f182c909f557125739bb065d4e92f58e9
3
+ metadata.gz: df69f78931ad3bcdb9f27c97fec266fbe3ced8bc15ab1023e78fee58215ac81e
4
+ data.tar.gz: b1dba4fa0dfc0807d2c957550ed88ebac3195d90d9c3a027b6742bb04ffdbc6a
5
5
  SHA512:
6
- metadata.gz: 5715a8c111e862a1e560f1e095b4f601700f841a2bdb76dad9594c33774b9c5d369947a553a63d5a12ddd0240f2c09380f6e04baee3db28715ae56e5f2ffbccb
7
- data.tar.gz: d96915a2c9aaf4210491829e80ecb0785d706375f9a3610e38676c9e1708dc01db22b89e5f8a4a6daad49ef934b6e3147a4b13a00cdabe4cd6f0adcbb23e9d1b
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, sufijos = SUFIJOS)
12
+ def unsuffixed(attribute)
13
13
  ret = attribute.to_s.dup
14
14
 
15
- sufijos.each do |sufijo|
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
- object.send(unsuffixed_for_export(att))
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.6.24-3'
4
+ VERSION = '7.6.24-4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.24.pre.3
4
+ version: 7.6.24.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso