effective_datatables 3.0.5 → 3.0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6baae8c780d1f157f3ffeaab844b16e923514236
|
4
|
+
data.tar.gz: a51f0b958bd5570bf449e38c7a5c912ad7b0e3a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbd77588b6c63d4eb651eedd870d2fc0648d01c92bdfba957c7928fa36b292465037a069def544afaeb086f3fa81058b4bf671b1ccc8f26fdf7f0a551fd98909
|
7
|
+
data.tar.gz: 72d53698fe71bb5bd0ae20605422a76648e90b90d203537ce0a5a7a79602ad5a8df663ddacac173da5d86cecb9593a474b8164a16f5a764f4d20e99f45adad9b
|
@@ -52,6 +52,8 @@ module Effective
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def format_column(value, column)
|
55
|
+
return if value.nil?
|
56
|
+
|
55
57
|
case column[:as]
|
56
58
|
when :boolean
|
57
59
|
case value
|
@@ -60,23 +62,23 @@ module Effective
|
|
60
62
|
when String ; value
|
61
63
|
end
|
62
64
|
when :currency
|
63
|
-
view.number_to_currency(value)
|
65
|
+
view.number_to_currency(value)
|
64
66
|
when :date
|
65
|
-
(value.strftime('%F') rescue BLANK)
|
67
|
+
(value.strftime('%F') rescue BLANK)
|
66
68
|
when :datetime
|
67
|
-
(value.strftime('%F %H:%M') rescue BLANK)
|
69
|
+
(value.strftime('%F %H:%M') rescue BLANK)
|
68
70
|
when :decimal
|
69
71
|
value
|
70
72
|
when :duration
|
71
|
-
view.number_to_duration(value)
|
73
|
+
view.number_to_duration(value)
|
72
74
|
when :effective_addresses
|
73
|
-
value.to_html
|
75
|
+
value.to_html
|
74
76
|
when :effective_obfuscation
|
75
77
|
value
|
76
78
|
when :effective_roles
|
77
79
|
value.join(', ')
|
78
80
|
when :email
|
79
|
-
view.mail_to(value)
|
81
|
+
view.mail_to(value)
|
80
82
|
when :integer
|
81
83
|
value
|
82
84
|
when :percentage
|
@@ -86,8 +88,11 @@ module Effective
|
|
86
88
|
when String ; value
|
87
89
|
end
|
88
90
|
when :price
|
89
|
-
|
90
|
-
view.number_to_currency(value / 100.0)
|
91
|
+
case value
|
92
|
+
when Integer ; view.number_to_currency(value / 100.0) # an Integer representing the number of cents
|
93
|
+
when Numeric ; view.number_to_currency(value)
|
94
|
+
when String ; value
|
95
|
+
end
|
91
96
|
else
|
92
97
|
value.to_s
|
93
98
|
end
|