zutils 0.4.3 → 0.4.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: d3cd4aace4730d5f5cf066943ce4971d0dac4404a8fe7b7c73e7d7c3437aad11
4
- data.tar.gz: 992e6b14a629069ce2c54b82e696c7ed45108c23de2c0bf0610cc74944f62383
3
+ metadata.gz: df6c3780c457eeaa243e2ad25e0b3f353fc8e9901bcef670cbda4fb446cda471
4
+ data.tar.gz: afcf7a3976c562678cbced427916b0ffe22b536c8a205bf6e161b8b29997dd75
5
5
  SHA512:
6
- metadata.gz: 63923805827527085aa1dcb9238580c2a48c85596a3af2b0796eec666d56a173ccdc7c1bc829daa90a3d6febdfbdf81b4b2970d32d21efb11986390dad3843ec
7
- data.tar.gz: 1863c982819053125d987fabd623e63b95346e577b7d8d23c54227c13ae258d6f7e184aff3a04e117f11b89db2cd0a1da5d2d83e8d3b8c155347b72bd5f2c9b6
6
+ metadata.gz: f392ba6d0989f76f4fbcc34920d3f446d7f233965845118df10931431ddfc9a3334b3940b7971a80d100722e5c5a48aae408c74daf984ccb71dda25d421b9048
7
+ data.tar.gz: 3a58ed27dadb041688132507c7d42455b76b50b7a34f874b132df1c17e96005c2e578c5446f6a3c89e4311be88a272f5a1cea245d95a33ef62fb9f48cfee1493
@@ -51,16 +51,20 @@
51
51
  <% show_columns.each do |column| %>
52
52
  <% next if /_currency$/ =~ column %>
53
53
  <td>
54
- <% if object.send(column).class == Date or
54
+ <% if object.respond_to?(column) && (
55
+ object.send(column).class == Date or
55
56
  object.send(column).class == DateTime or
56
57
  object.send(column).class == ActiveSupport::TimeWithZone or
57
- object.send(column).class == Time %>
58
+ object.send(column).class == Time) %>
58
59
  <%=l object.send(column) %>
59
60
  <% elsif /_id$/ =~ column && object.respond_to?(column.split('_id')[0]) %>
60
61
  <%= object.send(column.split("_id")[0])&.name %>
61
62
  <% elsif /_cents$/ =~ column %>
62
63
  <%= number_to_currency object.send(column.split("_cents")[0]) %>
63
64
  <% elsif /_currency$/ =~ column %>
65
+ <!-- faz nada -->
66
+ <% elsif column.include?(".") %>
67
+ <%= eval("object.#{column}") %>
64
68
  <% elsif column == 'id' %>
65
69
  <%= link_to object.id, object %>
66
70
  <% else %>
@@ -1,3 +1,3 @@
1
1
  module Zutils
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-24 00:00:00.000000000 Z
11
+ date: 2019-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubygems_version: 3.0.1
102
+ rubygems_version: 3.0.3
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Utilidades gerais para aplicações rails