wice_grid 3.4.5 → 3.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +1 -14
- data/lib/wice_grid.rb +20 -9
- data/wice_grid.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90ee3cc8cd5f0d12ec80f8823a319ec859ea4a9f
|
4
|
+
data.tar.gz: 3f0b2ff578c99d36e6dfbfdc948bb08cfe281c03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99b0d994de925b26019f399f789cd783391999b3e0163d9e93a7135b03b1740c5aab7b33e266b491b6cd25605b4ea4f26d5b724d2df7d7cfb7dffe9a284fa9aa
|
7
|
+
data.tar.gz: 4431cecfcaccf0b9d80c16d75e30e7298ce347dbff1568d5efe62999c46497de85cd534a12c435c1edd1c7479862186fe0ed644e5d4190dc13e304c648661ff3
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= WiceGrid
|
2
2
|
|
3
|
-
Version:: 3.4.
|
3
|
+
Version:: 3.4.6
|
4
4
|
Author:: Yuri Leikind
|
5
5
|
Sources:: https://github.com/leikind/wice_grid/
|
6
6
|
Examples online:: http://wicegrid.herokuapp.com
|
@@ -14,19 +14,6 @@ For rails 2 use the +master+ branch: https://github.com/leikind/wice_grid/tree/
|
|
14
14
|
|
15
15
|
Rails 4 is supported beginning with version 3.4.x.
|
16
16
|
|
17
|
-
However, with WiceGrid 3.4.0 Rails 4 produces the following deprecation message:
|
18
|
-
|
19
|
-
DEPRECATION WARNING: It looks like you are eager loading table(s) (one of: tasks, statuses) that are referenced in a string SQL snippet. For example:
|
20
|
-
|
21
|
-
Post.includes(:comments).where("comments.title = 'foo'")
|
22
|
-
|
23
|
-
Currently, Active Record recognizes the table in the string, and knows to JOIN the comments table to the query, rather than loading comments in a separate query. However, doing this without writing a full-blown SQL parser is inherently flawed. Since we don't want to write an SQL parser, we are removing this functionality. From now on, you must explicitly tell Active Record when you are referencing a table from a string:
|
24
|
-
|
25
|
-
Post.includes(:comments).where("comments.title = 'foo'").references(:comments)
|
26
|
-
|
27
|
-
This will be fixed in future versions of WiceGrid.
|
28
|
-
|
29
|
-
|
30
17
|
|
31
18
|
== Intro
|
32
19
|
|
data/lib/wice_grid.rb
CHANGED
@@ -279,12 +279,19 @@ module Wice
|
|
279
279
|
end
|
280
280
|
|
281
281
|
|
282
|
+
def add_references relation #:nodoc:
|
283
|
+
if @ar_options[:include] && relation.respond_to?(:references)
|
284
|
+
refs = [@ar_options[:include]] unless @ar_options[:include].is_a?(Array)
|
285
|
+
relation = relation.references(* @ar_options[:include])
|
286
|
+
end
|
287
|
+
relation
|
288
|
+
end
|
289
|
+
|
282
290
|
# TO DO: what to do with other @ar_options values?
|
283
291
|
def read #:nodoc:
|
284
292
|
form_ar_options
|
285
293
|
@klass.unscoped do
|
286
294
|
@resultset = if self.output_csv? || all_record_mode?
|
287
|
-
# @relation.find(:all, @ar_options)
|
288
295
|
@relation.
|
289
296
|
includes(@ar_options[:include]).
|
290
297
|
joins( @ar_options[:joins]).
|
@@ -301,9 +308,7 @@ module Wice
|
|
301
308
|
order( @ar_options[:order]).
|
302
309
|
where( @ar_options[:conditions])
|
303
310
|
|
304
|
-
|
305
|
-
relation = relation.references(@ar_options[:include])
|
306
|
-
end
|
311
|
+
relation = add_references relation
|
307
312
|
|
308
313
|
relation
|
309
314
|
end
|
@@ -532,10 +537,14 @@ module Wice
|
|
532
537
|
def resultset_without_paging_without_user_filters #:nodoc:
|
533
538
|
form_ar_options
|
534
539
|
@klass.unscoped do
|
535
|
-
@relation.joins(@ar_options[:joins]).
|
536
|
-
|
537
|
-
|
538
|
-
|
540
|
+
relation = @relation.joins(@ar_options[:joins]).
|
541
|
+
includes(@ar_options[:include]).
|
542
|
+
group(@ar_options[:group]).
|
543
|
+
where(@options[:conditions])
|
544
|
+
|
545
|
+
relation = add_references relation
|
546
|
+
|
547
|
+
relation
|
539
548
|
end
|
540
549
|
end
|
541
550
|
|
@@ -554,7 +563,7 @@ module Wice
|
|
554
563
|
|
555
564
|
def resultset_without_paging_with_user_filters #:nodoc:
|
556
565
|
@klass.unscoped do
|
557
|
-
active_relation_for_resultset_without_paging_with_user_filters.
|
566
|
+
active_relation_for_resultset_without_paging_with_user_filters.to_a
|
558
567
|
end
|
559
568
|
end
|
560
569
|
|
@@ -567,6 +576,8 @@ module Wice
|
|
567
576
|
joins(@ar_options[:joins]).
|
568
577
|
includes(@ar_options[:include]).
|
569
578
|
order(@ar_options[:order])
|
579
|
+
|
580
|
+
relation = add_references relation
|
570
581
|
end
|
571
582
|
relation
|
572
583
|
end
|
data/wice_grid.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'wice_grid'
|
3
|
-
s.version = '3.4.
|
3
|
+
s.version = '3.4.6'
|
4
4
|
s.homepage = 'https://github.com/leikind/wice_grid'
|
5
|
-
s.date = '2014-08-
|
5
|
+
s.date = '2014-08-25'
|
6
6
|
s.summary = 'A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters.'
|
7
7
|
s.description = 'A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters.' +
|
8
8
|
'One of the goals of this plugin was to allow the programmer to define the contents of the cell by himself, ' +
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wice_grid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Leikind
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kaminari
|