effective_datatables 1.1.6 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/datatable.rb +16 -0
- data/lib/effective_datatables/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cac210863d261aefc49a0143d72be5111108cb88
|
4
|
+
data.tar.gz: 63281eaaec4afe44f78a33b46ed532231f6d168b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09cc07fd28c9ff8669fa00bdc18e0445f64d4f4213702c3063e7dffa62fa32bc326b030ca05d1b2377c1270ba8ca6217373dc18147a5d0dea6b1697d32191ffb
|
7
|
+
data.tar.gz: 1b4e19fdcd722c4f5577aefa36662e91b59b246571f0a45d67602c413f77b8b85c69722e3425674c06d469478e6f9d17298d3f7e52ec57cf359833e55e17a4d2
|
@@ -40,6 +40,7 @@ module Effective
|
|
40
40
|
def default_order(name, direction = :asc)
|
41
41
|
@default_order = {name => direction}
|
42
42
|
end
|
43
|
+
|
43
44
|
end
|
44
45
|
|
45
46
|
def initialize(*args)
|
@@ -152,8 +153,23 @@ module Effective
|
|
152
153
|
def view=(view_context)
|
153
154
|
@view = view_context
|
154
155
|
@view.formats = [:html]
|
156
|
+
|
157
|
+
# 'Just work' with attributes
|
155
158
|
@view.class.send(:attr_accessor, :attributes)
|
156
159
|
@view.attributes = self.attributes
|
160
|
+
|
161
|
+
# "Copy & Paste" any additional methods defined on the datatable into the view_context
|
162
|
+
begin
|
163
|
+
methods_for_view = ''
|
164
|
+
|
165
|
+
(self.class.instance_methods(false) - [:collection, :search_column]).each do |instance_method|
|
166
|
+
methods_for_view << self.class.instance_method(instance_method).source
|
167
|
+
end
|
168
|
+
|
169
|
+
@view.class.module_eval(methods_for_view)
|
170
|
+
rescue => e
|
171
|
+
end
|
172
|
+
|
157
173
|
end
|
158
174
|
|
159
175
|
protected
|
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: 1.
|
4
|
+
version: 1.2.0
|
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: 2015-
|
11
|
+
date: 2015-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|