datagrid 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/datagrid.gemspec +5 -5
- data/lib/datagrid/columns.rb +1 -1
- data/lib/datagrid/drivers/active_record.rb +1 -0
- data/spec/datagrid/columns_spec.rb +1 -1
- data/spec/datagrid/drivers/active_record_spec.rb +2 -3
- data/spec/datagrid/form_builder_spec.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cf5af4041b5836e7938747ba830e28bda894965
|
4
|
+
data.tar.gz: 44863f33c721396345e89a6d32f4d1030a1d0128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a651f92eb381d9f9d268ffe20cfa2d2c8aa559adc7b1a11840e86ca1b0ed2e296e45a1471e7c47b9b8692b6cdc51b8180e960594eb99e33ba6a5f9de43b3e810
|
7
|
+
data.tar.gz: da1cc6b18029502799af4395a0c9b846a87449272292543121668fc916c2f841d9bc7c1368d4a8cbc50bac10eaa3a590fe9639f415e6f2f3befab424e45a1ff2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/datagrid.gemspec
CHANGED
@@ -2,16 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: datagrid 1.1.
|
5
|
+
# stub: datagrid 1.1.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "datagrid"
|
9
|
-
s.version = "1.1.
|
9
|
+
s.version = "1.1.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
12
|
s.authors = ["Bogdan Gusiev"]
|
14
|
-
s.date = "2014-03-
|
13
|
+
s.date = "2014-03-08"
|
15
14
|
s.description = "This allows you to easily build datagrid aka data tables with sortable columns and filters"
|
16
15
|
s.email = "agresso@gmail.com"
|
17
16
|
s.extra_rdoc_files = [
|
@@ -111,7 +110,8 @@ Gem::Specification.new do |s|
|
|
111
110
|
]
|
112
111
|
s.homepage = "http://github.com/bogdan/datagrid"
|
113
112
|
s.licenses = ["MIT"]
|
114
|
-
s.
|
113
|
+
s.require_paths = ["lib"]
|
114
|
+
s.rubygems_version = "2.1.10"
|
115
115
|
s.summary = "Ruby gem to create datagrids"
|
116
116
|
|
117
117
|
if s.respond_to? :specification_version then
|
data/lib/datagrid/columns.rb
CHANGED
@@ -172,7 +172,7 @@ module Datagrid
|
|
172
172
|
module InstanceMethods
|
173
173
|
|
174
174
|
def assets
|
175
|
-
driver.append_column_queries(super, columns.
|
175
|
+
driver.append_column_queries(super, columns.select(&:query))
|
176
176
|
end
|
177
177
|
|
178
178
|
# Returns <tt>Array</tt> of human readable column names. See also "Localization" section
|
@@ -31,6 +31,7 @@ module Datagrid
|
|
31
31
|
if assets.select_values.empty?
|
32
32
|
assets = assets.select(Arel.respond_to?(:star) ? assets.klass.arel_table[Arel.star] : "#{assets.quoted_table_name}.*")
|
33
33
|
end
|
34
|
+
columns = columns.map {|c| "#{c.query} AS #{c.name}"}
|
34
35
|
assets = assets.select(*columns)
|
35
36
|
end
|
36
37
|
assets
|
@@ -17,8 +17,7 @@ describe Datagrid::Drivers::ActiveRecord do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should support append_column_queries" do
|
20
|
-
scope = subject.append_column_queries(Entry.scoped, ['sum(entries.group_id)
|
21
|
-
scope.
|
22
|
-
scope.select_values.should == ["#{Entry.quoted_table_name}.*", 'sum(entries.group_id) sum_group_id']
|
20
|
+
scope = subject.append_column_queries(Entry.scoped, [Datagrid::Columns::Column.new(SimpleReport, :sum_group_id, 'sum(entries.group_id)')])
|
21
|
+
scope.to_sql.should == 'SELECT "entries".*, sum(entries.group_id) AS sum_group_id FROM "entries" '
|
23
22
|
end
|
24
23
|
end
|
@@ -25,7 +25,9 @@ describe Datagrid::FormBuilder do
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
subject
|
28
|
+
subject do
|
29
|
+
view.datagrid_filter(_filter, _filter_options)
|
30
|
+
end
|
29
31
|
let(:_filter_options) { {} }
|
30
32
|
context "with default filter type" do
|
31
33
|
let(:_grid) {
|
@@ -245,7 +247,7 @@ describe Datagrid::FormBuilder do
|
|
245
247
|
end
|
246
248
|
end
|
247
249
|
let(:_filter) { :category }
|
248
|
-
if Rails.version >= "4.0"
|
250
|
+
if true || Rails.version >= "4.0"
|
249
251
|
it { should equal_to_dom(
|
250
252
|
'
|
251
253
|
<label class="category enum_filter checkboxes" for="report_category_first"><input id="report_category_first" name="report[category][]" type="checkbox" value="first" />first</label>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datagrid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdan Gusiev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -324,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
324
324
|
version: '0'
|
325
325
|
requirements: []
|
326
326
|
rubyforge_project:
|
327
|
-
rubygems_version: 2.
|
327
|
+
rubygems_version: 2.1.10
|
328
328
|
signing_key:
|
329
329
|
specification_version: 4
|
330
330
|
summary: Ruby gem to create datagrids
|