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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cd15b564ccd9911c90cd62080d8797311ebe195
4
- data.tar.gz: 019aac72f5a5f12e2965a479be7ceec15d144002
3
+ metadata.gz: cac210863d261aefc49a0143d72be5111108cb88
4
+ data.tar.gz: 63281eaaec4afe44f78a33b46ed532231f6d168b
5
5
  SHA512:
6
- metadata.gz: d011aab9e624580907bfdb20b97cefdd2dc66505e52a514829402b839618880989e7c4b0e77cd652b71ae40e8f418bbe451c1d235907f88239cc239ab667f2dc
7
- data.tar.gz: 027b7f55bce90c8859f29ccae88c78cc5954f431f8b91314956cd754bad8ca506cd2ea3150b469c9e8354543b1416863d1782f53bfce1a8b974177dad7fb7ec9
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '1.1.6'.freeze
2
+ VERSION = '1.2.0'.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: 1.1.6
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-01-30 00:00:00.000000000 Z
11
+ date: 2015-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails