wice_grid_mongoid 6.0.4 → 6.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.0.4
1
+ 6.0.5
@@ -750,7 +750,7 @@ module Wice
750
750
 
751
751
  def pagination_info(grid, allow_showing_all_records) #:nodoc:
752
752
  found = grid.resultset.count
753
- total = grid.klass.count
753
+ total = grid.extra_filter.count
754
754
  shown = [found, grid.status[:per_page].to_i].min
755
755
  summary = ""
756
756
  summary << "Shown: #{shown}"
data/lib/wice_grid.rb CHANGED
@@ -45,7 +45,7 @@ module Wice
45
45
  class WiceGrid
46
46
 
47
47
  attr_reader :klass, :name, :resultset, :custom_order, :query_store_model, :options, :controller
48
- attr_reader :ar_options, :status, :export_to_csv_enabled, :csv_file_name, :saved_query
48
+ attr_reader :ar_options, :status, :export_to_csv_enabled, :csv_file_name, :saved_query, :extra_filter
49
49
  attr_writer :renderer
50
50
  attr_accessor :output_buffer, :view_helper_finished, :csv_tempfile
51
51
 
@@ -134,6 +134,11 @@ module Wice
134
134
  @criteria_formed = false
135
135
  end
136
136
 
137
+ def add_criteria(extra)
138
+ @extra_filter = extra
139
+ @criteria.merge(extra)
140
+ end
141
+
137
142
  def has_any_filter_criteria?
138
143
  @has_any_filter_criteria
139
144
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wice_grid_mongoid}
8
- s.version = "6.0.4"
8
+ s.version = "6.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Yuri Leikind", "Aleksandr Furmanov"]
12
- s.date = %q{2010-11-30}
12
+ s.date = %q{2010-12-10}
13
13
  s.description = %q{A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters }
14
14
  s.email = %q{aleksandr.furmanov@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wice_grid_mongoid
3
3
  version: !ruby/object:Gem::Version
4
- hash: 39
4
+ hash: 37
5
5
  prerelease: false
6
6
  segments:
7
7
  - 6
8
8
  - 0
9
- - 4
10
- version: 6.0.4
9
+ - 5
10
+ version: 6.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yuri Leikind
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-30 00:00:00 -08:00
19
+ date: 2010-12-10 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies: []
22
22