rails-tables 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ $ ->
2
+ $('table.datatable').bind 'sort', ->
3
+ $(@).closest('table.datatable').data('unsorted', false)
4
+ $('table.datatable').one 'sort', ->
5
+ $(@).closest('table.datatable').data('unsorted', true)
6
+
1
7
  @rails_tables = {}
2
8
  @rails_tables.columns = ->
3
9
  for column, order of $(@).data() when /_ordering/.test(column)
@@ -7,7 +13,3 @@
7
13
  aoData.push
8
14
  name: 'bUseDefaultSort', value: if $(@).data('unsorted') then true else false
9
15
 
10
- $ ->
11
- $('table.datatable').each ->
12
- $(@).find('.aria-sort').click ->
13
- $(@).parents('table.datatable').data('unsorted', false)
data/app/tables/column.rb CHANGED
@@ -21,6 +21,13 @@ class Column
21
21
  end
22
22
  end
23
23
 
24
+ def render(object)
25
+ self.relation_chain.each do |relation|
26
+ object = object.send(relation)
27
+ end
28
+ end
29
+
30
+
24
31
  def default_render(view, object)
25
32
  property = object.send(self.column_name)
26
33
  property if not property.nil?
@@ -1,3 +1,3 @@
1
1
  module RailsTables
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-tables
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-20 00:00:00.000000000 Z
12
+ date: 2012-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails