effective_datatables 4.8.0 → 4.8.1

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: c5a9a4233ee452020c92387b3bb140eac9df58bd52548c55a2eb41881c731f67
4
- data.tar.gz: f738131e50148095ea9c1cee3b0f68911d4b2a4f1815b7d5aa6445ec4d849a49
3
+ metadata.gz: 762d954082ec93156704b59d91d3561e78fd65234ed393ee7dac36683626a592
4
+ data.tar.gz: 198e37ee689048542d90a9941a22ee770dcb3d44c7f02013ff01da995a0521f7
5
5
  SHA512:
6
- metadata.gz: 2279b8c6b0f72dc5427a2d0cc876ee83021806a3152d325edcccbaf8532dd65de27c1a8275320a306568790a60965d6235ee585e4bba41c1337148568df62d51
7
- data.tar.gz: a7e514c7caf226a633fbd5d6098df1241b38336343fc9d6927f3bab07419d56300c06c4cecab752ed4a43819f9f6946c820cff5af7e0b25c317922a06625155e
6
+ metadata.gz: b70a0df892db57d89ecd7008dd4ab6f0d498d219a51a6761950911aa5491ffc5d57638c3bf203e563489faa57155d5374a6ff88a18faa53eec79b5e7e0c7fba2
7
+ data.tar.gz: '0545898ea59aaab094bb7c454d69e27a970b56426a5571b1c811698f5f80c20042ed269f558f5b4e9afac3d1e579f36edbe1685f5762a114de7fe1ccee713778'
@@ -149,6 +149,8 @@ module EffectiveDatatablesPrivateHelper
149
149
  elsif as == :boolean
150
150
  collection ||= [true, false].map { |value| [t("effective_datatables.boolean_#{value}"), value] }
151
151
  form.public_send(:select, name, collection, options) # boolean
152
+ elsif as == :string
153
+ form.public_send(:text_field, name, options)
152
154
  elsif form.respond_to?(as)
153
155
  form.public_send(as, name, options) # check_box, text_area
154
156
  else
@@ -20,7 +20,7 @@ module Effective
20
20
  elsif value != nil
21
21
  Effective::Attribute.new(value).type
22
22
  end
23
- ) || :text
23
+ ) || :string
24
24
 
25
25
  datatable._filters[name.to_sym] = {
26
26
  value: value,
@@ -198,7 +198,7 @@ module Effective
198
198
  def parse_filter_value(filter, value)
199
199
  return filter[:parse].call(value) if filter[:parse]
200
200
  return nil if value.blank? && !filter[:required]
201
- Effective::Attribute.new(filter[:value]).parse(value, name: filter[:name])
201
+ Effective::Attribute.new(filter[:as] || filter[:value] || :string).parse(value, name: filter[:name])
202
202
  end
203
203
 
204
204
  def cookie_state_params
@@ -35,7 +35,7 @@ EffectiveDatatables.setup do |config|
35
35
  config.save_state = true
36
36
 
37
37
  # Configure the _effective_dt cookie.
38
- config.cookie_max_size = 2000 # String size. Final byte size is about 1.5 times bigger, after rails signs it
38
+ config.cookie_max_size = 1500 # String size. Final byte size is about 1.5 times bigger, after rails signs it
39
39
  config.cookie_domain = :all # Should usually be :all
40
40
  config.cookie_tld_length = nil # Leave nil to autodetect, or set to probably 2
41
41
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.8.0'.freeze
2
+ VERSION = '4.8.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.0
4
+ version: 4.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-31 00:00:00.000000000 Z
11
+ date: 2020-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails