snaptable 2.0.5 → 2.1.0

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: c55dc0580cf97a22c1845dc289b3f32a3286863b
4
- data.tar.gz: 86aaf1bc56afc042624559c2c5f2f924f5ed1230
3
+ metadata.gz: 6edfbac91d3d9a0930ebc3ed0d430a58b7c3851b
4
+ data.tar.gz: d06c18668c831f9cf2ae3d8a0f5c63a03cd230a0
5
5
  SHA512:
6
- metadata.gz: b320f762bf32aedc96750abb98fd678969c3430a64534cbf4aca3a86b2ceed4e2ad9b3dd0a37d095edf270e2e7f96df00302f17ea0992d053f90cdfb8d4d6004
7
- data.tar.gz: 356516f8fac06e0dddb7e2171da2406d63a751579dac918307a044e5548cf90619b83e6b807c3370d09d2dcdedba4bed228ece750e19b5d6ebc507a1bebd2489
6
+ metadata.gz: d5706288fb9030274d7469d950e2b60a664a100e11523abf00132705bcff26952e2d9eb455f88732fd24b72e074f360397b6789face063d5ce8a502010cef9cd
7
+ data.tar.gz: 1fa2661b90067c7ce758d8a7c2f146161191c56f6341105c750671263de8b6bc95b7077f54089ac0a5feca72e029f9898adc15a05c14f10e6b1397b8ce561c6b
@@ -19,7 +19,7 @@
19
19
  <% presenter.records.each do |record| %>
20
20
  <tr class="<%= cycle('odd', 'even') %>" data-url="<%= record.send(presenter.url) %>">
21
21
  <% presenter.values(record).each do |value| %>
22
- <td><%= truncate((strip_tags value), length: 40) %></td>
22
+ <td><%= value %></td>
23
23
  <% end %>
24
24
  </tr>
25
25
  <% end %>
@@ -39,12 +39,13 @@ module Snaptable
39
39
 
40
40
  def format(attribute, attr_value)
41
41
  if attr_value.is_a?(Date) || attr_value.is_a?(Time) || attr_value.is_a?(DateTime)
42
- l attr_value, format: :snaptable
42
+ attr_value = l(attr_value, format: :snaptable)
43
43
  elsif !attr_value.nil? && attribute.to_s.in?(enums)
44
- t "#{model.model_name.i18n_key}.#{attribute.to_s.pluralize}.#{attr_value}"
45
- else
46
- attr_value
47
- end.to_s
44
+ attr_value = t("#{model.model_name.i18n_key}.#{attribute.to_s.pluralize}.#{attr_value}")
45
+ end
46
+ attr_value = view_context.strip_tags(attr_value.to_s)
47
+ attr_value = view_context.truncate(attr_value, length: 40) unless options[:truncate] == false
48
+ return attr_value
48
49
  end
49
50
 
50
51
  def enums
@@ -1,3 +1,3 @@
1
1
  module Snaptable
2
- VERSION = "2.0.5"
2
+ VERSION = "2.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snaptable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - khcr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-20 00:00:00.000000000 Z
11
+ date: 2018-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails