effective_datatables 2.6.15 → 2.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/effective_datatables/_overrides.scss.erb +1 -1
- data/app/assets/stylesheets/effective_datatables/_scopes.scss +8 -0
- data/app/assets/stylesheets/effective_datatables.scss +2 -0
- data/app/helpers/effective_datatables_controller_helper.rb +11 -0
- data/app/models/effective/datatable.rb +1 -1
- data/app/models/effective/effective_datatable/options.rb +7 -2
- data/app/views/effective/datatables/_scopes.html.haml +1 -1
- data/app/views/effective/datatables/index.html.haml +2 -0
- data/lib/effective_datatables/engine.rb +2 -0
- data/lib/effective_datatables/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0db1b45edf40f52aa0419d0ade8b440b191bede
|
4
|
+
data.tar.gz: be8443850e6d0d9eaf1d6072782c212c7616eb76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b84a7aef73fe0f4f58153e69bc5f1dffaea6dfc1d62689e6c4b9be1a564549caa12968d07a8331437c0eeeb20a6844242884d888d26f64dedf2d1302e51767c
|
7
|
+
data.tar.gz: cc7eafce76ae1659c13a9efc10862f5ab35f7068780ec8a11dee197c77d3f701a172e37a930fc14825245f05e23ae433e8de77c2e725ad55a39e33544bf7291b
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# These are expected to be called by a developer. They are part of the datatables DSL.
|
2
|
+
module EffectiveDatatablesControllerHelper
|
3
|
+
|
4
|
+
def render_datatable_index(datatable)
|
5
|
+
raise 'expected Effective::Datatable' unless datatable.kind_of?(Effective::Datatable)
|
6
|
+
|
7
|
+
@datatable = datatable
|
8
|
+
render file: 'effective/datatables/index'
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -23,7 +23,7 @@ module Effective
|
|
23
23
|
def initialize(*args)
|
24
24
|
if args.present? && args.first != nil
|
25
25
|
raise "#{self.class.name}.new() can only be initialized with a Hash like arguments" unless args.first.kind_of?(Hash)
|
26
|
-
args.first.each { |k, v| self.attributes[k] = v }
|
26
|
+
args.first.each { |k, v| self.attributes[k] = v.presence }
|
27
27
|
end
|
28
28
|
|
29
29
|
if respond_to?(:initialize_scopes) # There was at least one scope defined in the scopes do .. end block
|
@@ -31,9 +31,14 @@ module Effective
|
|
31
31
|
# We want to make sure an input_html: { value: default } exists
|
32
32
|
def _initialize_scope_options(scopes)
|
33
33
|
(scopes || []).each do |name, options|
|
34
|
-
value = attributes.key?(name) ? attributes[name] : options[:default]
|
34
|
+
value = attributes.key?(name) ? attributes[name].presence : options[:default]
|
35
35
|
|
36
|
-
if
|
36
|
+
if attributes.key?(name) == false
|
37
|
+
self.attributes[name] = options[:default]
|
38
|
+
value = options[:default]
|
39
|
+
end
|
40
|
+
|
41
|
+
if (options[:fallback] || options[:presence]) && attributes[name].blank?
|
37
42
|
self.attributes[name] = options[:default]
|
38
43
|
value = options[:default]
|
39
44
|
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: 2.6.
|
4
|
+
version: 2.6.16
|
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: 2016-10-
|
11
|
+
date: 2016-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -133,7 +133,9 @@ files:
|
|
133
133
|
- app/assets/stylesheets/dataTables/responsive/responsive.bootstrap.css
|
134
134
|
- app/assets/stylesheets/effective_datatables.scss
|
135
135
|
- app/assets/stylesheets/effective_datatables/_overrides.scss.erb
|
136
|
+
- app/assets/stylesheets/effective_datatables/_scopes.scss
|
136
137
|
- app/controllers/effective/datatables_controller.rb
|
138
|
+
- app/helpers/effective_datatables_controller_helper.rb
|
137
139
|
- app/helpers/effective_datatables_helper.rb
|
138
140
|
- app/helpers/effective_datatables_private_helper.rb
|
139
141
|
- app/models/effective/access_denied.rb
|
@@ -158,6 +160,7 @@ files:
|
|
158
160
|
- app/views/effective/datatables/_datatable.html.haml
|
159
161
|
- app/views/effective/datatables/_scopes.html.haml
|
160
162
|
- app/views/effective/datatables/_spacer_template.html
|
163
|
+
- app/views/effective/datatables/index.html.haml
|
161
164
|
- config/routes.rb
|
162
165
|
- lib/effective_datatables.rb
|
163
166
|
- lib/effective_datatables/engine.rb
|