tablets 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/app/assets/javascripts/tablets/tablet.js.coffee +1 -1
- data/app/controllers/tablets/ajax_controller.rb +1 -1
- data/lib/tablets/data.rb +3 -2
- data/lib/tablets/version.rb +1 -1
- metadata +8 -14
- data/spec/lib/tablets/data/processing/filter_spec.rb +0 -9
- data/spec/lib/tablets/data/processing/order_spec.rb +0 -9
- data/spec/lib/tablets/data_spec.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d046e5a6fa2f522b63f13c69f724ff82473387c
|
4
|
+
data.tar.gz: 8587012faa26256221152719f81b85456d8621de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa268e7dc0dd793dfcacbbfefef99d90889f37664edb250745caa05d81a8fe00b88bc66d26a60c96f9e8df5e8052f783984efddfb4a02a84215bd75f6d2ac871
|
7
|
+
data.tar.gz: 884625f076e9e455246648e4d8858c8677940acedaa6dc9b62d9468fbf40fcc0b465bcbb4662a6ae322abbaca01340e2433370a467ac9ed815ec61884c256b7b
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Tablets
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/tablets.svg)](http://badge.fury.io/rb/tablets)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/zenedge/tablets/badges/gpa.svg)](https://codeclimate.com/github/zenedge/tablets)
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/zenedge/tablets/badges/coverage.svg)](https://codeclimate.com/github/zenedge/tablets/coverage)
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -56,7 +58,7 @@ Tablets.register :posts do
|
|
56
58
|
options: { className: 'post-title' }
|
57
59
|
}, {
|
58
60
|
title: 'User',
|
59
|
-
data:
|
61
|
+
data: proc { |user, controller| user == controller.current_user ? 'It is you' : [user.first_name, user.last_name].compact.join(' ') },
|
60
62
|
order: ['users.first_name', 'users.last_name'],
|
61
63
|
search: ['users.first_name', 'users.last_name']
|
62
64
|
}]
|
data/lib/tablets/data.rb
CHANGED
@@ -6,9 +6,10 @@ module Tablets
|
|
6
6
|
# Responsible to fetch and prepare data for jquery-datatables.
|
7
7
|
class Data
|
8
8
|
# Initializes data with tablet and params.
|
9
|
-
def initialize(tablet, params)
|
9
|
+
def initialize(tablet, params, controller)
|
10
10
|
@tablet = tablet
|
11
11
|
@params = params
|
12
|
+
@controller = controller
|
12
13
|
end
|
13
14
|
|
14
15
|
# Prepares data to render as json.
|
@@ -64,7 +65,7 @@ module Tablets
|
|
64
65
|
def cell(record, column)
|
65
66
|
case column[:data]
|
66
67
|
when Symbol then record.send(column[:data])
|
67
|
-
when Proc then column[:data].call(record)
|
68
|
+
when Proc then column[:data].call(record, @controller)
|
68
69
|
end
|
69
70
|
end
|
70
71
|
end
|
data/lib/tablets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tablets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yevhen Shemet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -131,11 +131,8 @@ files:
|
|
131
131
|
- lib/tablets/version.rb
|
132
132
|
- lib/tablets/view_helpers.rb
|
133
133
|
- spec/lib/tablets/data/processing/base_spec.rb
|
134
|
-
- spec/lib/tablets/data/processing/filter_spec.rb
|
135
|
-
- spec/lib/tablets/data/processing/order_spec.rb
|
136
134
|
- spec/lib/tablets/data/processing/paginate_spec.rb
|
137
135
|
- spec/lib/tablets/data/query_spec.rb
|
138
|
-
- spec/lib/tablets/data_spec.rb
|
139
136
|
- spec/lib/tablets/global/configurator_spec.rb
|
140
137
|
- spec/lib/tablets/global/loader_spec.rb
|
141
138
|
- spec/lib/tablets/global/store_spec.rb
|
@@ -163,21 +160,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
160
|
version: '0'
|
164
161
|
requirements: []
|
165
162
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.4.
|
163
|
+
rubygems_version: 2.4.8
|
167
164
|
signing_key:
|
168
165
|
specification_version: 4
|
169
166
|
summary: Wrapper around jquery-datatables.
|
170
167
|
test_files:
|
171
|
-
- spec/
|
172
|
-
- spec/lib/tablets/utils/config_spec.rb
|
173
|
-
- spec/lib/tablets/view_helpers_spec.rb
|
174
|
-
- spec/lib/tablets/renderer_spec.rb
|
168
|
+
- spec/spec_helper.rb
|
175
169
|
- spec/lib/tablets/data/processing/base_spec.rb
|
176
|
-
- spec/lib/tablets/data/processing/order_spec.rb
|
177
|
-
- spec/lib/tablets/data/processing/filter_spec.rb
|
178
170
|
- spec/lib/tablets/data/processing/paginate_spec.rb
|
179
171
|
- spec/lib/tablets/data/query_spec.rb
|
180
|
-
- spec/lib/tablets/global/loader_spec.rb
|
181
172
|
- spec/lib/tablets/global/store_spec.rb
|
182
173
|
- spec/lib/tablets/global/configurator_spec.rb
|
183
|
-
- spec/
|
174
|
+
- spec/lib/tablets/global/loader_spec.rb
|
175
|
+
- spec/lib/tablets/view_helpers_spec.rb
|
176
|
+
- spec/lib/tablets/utils/config_spec.rb
|
177
|
+
- spec/lib/tablets/renderer_spec.rb
|