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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e913c8334e69dc2a9c578d383753beb7fcc6cdb
4
- data.tar.gz: 515fa3c1e45512d7f386126ea5e809acb17caf91
3
+ metadata.gz: 90ee3cc8cd5f0d12ec80f8823a319ec859ea4a9f
4
+ data.tar.gz: 3f0b2ff578c99d36e6dfbfdc948bb08cfe281c03
5
5
  SHA512:
6
- metadata.gz: 2a083e373ad835ce7f4a05831434bd5dff65a61f721c4c6673c2494d857687f992ea7fc61662099d30daa30e4844bd1d78f441e718ba687a847849354c572ece
7
- data.tar.gz: 644ff92522639112d09017e532c30137803112bff1bed615c8fdcf3b9911ce28c44256cebf852f3a2ec382712ab098874ea9afeb1ed55003d46fc31465706124
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.2
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
- if relation.respond_to?(:references)
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
- includes(@ar_options[:include]).
537
- group(@ar_options[:group]).
538
- where(@options[:conditions])
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.all
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.5'
3
+ s.version = '3.4.6'
4
4
  s.homepage = 'https://github.com/leikind/wice_grid'
5
- s.date = '2014-08-23'
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.5
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-23 00:00:00.000000000 Z
11
+ date: 2014-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kaminari