effective_datatables 1.3.8 → 1.4.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: 85ab9195f55e5cda5a230b2ef153cb30e57131e7
4
- data.tar.gz: f696a35d412ef0a7bba8f656c73d85ce6fbdf308
3
+ metadata.gz: 593f29b32a9694bcd7c613456a0c489df2c9cccb
4
+ data.tar.gz: 8f48ded2f3b5ef8fe70d55119bd449ae5e26df1b
5
5
  SHA512:
6
- metadata.gz: 0a2703504e74126d6a38eac45228b87d29353dd219d2a1b4e217fb4413ab647a599e05ded5e1a9b305eac29de306248f70ea335e9b30500eb224bfcf2f553ba0
7
- data.tar.gz: 43013a15d4c48521a194be17eb7d7f4ddd23c49e256c673b965a0db0f8b269bb4ffc59b60675aaea3f9fea268df12964cfad9eb4561c11ce1494b3a24fc194cb
6
+ metadata.gz: a4c94c5e3595ee846ca94a0cac0e8dcd810876d614c6eb8d8d430716924eaea226df1e8a23d4a0c2fe06bb4d106024b82cb788df427d0ec993837170b9b6a355
7
+ data.tar.gz: 229563cf45ffda393845f2859c0376e147e27ca865cca9a26f5fb79abf19500dade2fdd6e5f448f9c55f120a027aa6647bf765f97f0725e3bdcb2e78ec610bc6
@@ -199,16 +199,12 @@ module Effective
199
199
  @view.class.send(:attr_accessor, :attributes)
200
200
  @view.attributes = self.attributes
201
201
 
202
- # "Copy & Paste" any additional methods defined on the datatable into the view_context
203
- begin
204
- methods_for_view = ''
202
+ # Delegate any methods defined on the datatable directly to our view
203
+ @view.class.send(:attr_accessor, :effective_datatable)
204
+ @view.effective_datatable = self
205
205
 
206
- (self.class.instance_methods(false) - [:collection, :search_column]).each do |instance_method|
207
- methods_for_view << self.class.instance_method(instance_method).source
208
- end
209
-
210
- @view.class.module_eval(methods_for_view)
211
- rescue => e
206
+ (self.class.instance_methods(false) - [:collection, :search_column]).each do |view_method|
207
+ @view.class_eval { delegate view_method, :to => :@effective_datatable }
212
208
  end
213
209
  end
214
210
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '1.3.8'.freeze
2
+ VERSION = '1.4.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.3.8
4
+ version: 1.4.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-03-23 00:00:00.000000000 Z
11
+ date: 2015-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails