data_table 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/data_table.gemspec +1 -1
- data/lib/data_table/mongoid.rb +1 -0
- data/lib/data_table/version.rb +1 -1
- data/spec/mongoid_data_table_spec.rb +2 -2
- metadata +2 -2
data/data_table.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
21
|
s.add_dependency "rails", "~>3.0.0"
|
22
|
-
s.add_dependency "will_paginate", "
|
22
|
+
s.add_dependency "will_paginate", "3.0.pre2"
|
23
23
|
|
24
24
|
s.add_development_dependency "rspec", "~>2.0.0"
|
25
25
|
s.add_development_dependency "shoulda", "~>2.11.0"
|
data/lib/data_table/mongoid.rb
CHANGED
@@ -4,6 +4,7 @@ module DataTable
|
|
4
4
|
def _find_objects params, fields, search_fields
|
5
5
|
self.where(_where_conditions params[:sSearch], search_fields).
|
6
6
|
order_by(_order_by_fields params, fields).
|
7
|
+
limit(_per_page params).
|
7
8
|
paginate :page => _page(params), :per_page => _per_page(params)
|
8
9
|
end
|
9
10
|
|
data/lib/data_table/version.rb
CHANGED
@@ -12,8 +12,8 @@ describe DataTable do
|
|
12
12
|
mock(self)._order_by_fields(params, %w(foo bar baz)) { "order by" }
|
13
13
|
|
14
14
|
mock(self)._page(params) { :page }
|
15
|
-
mock(self)._per_page(params) { :per_page }
|
16
|
-
mock(self).where("where clause") { mock!.order_by("order by") { mock!.paginate({:page => :page, :per_page => :per_page}) { :answer } } }
|
15
|
+
mock(self)._per_page(params) { :per_page }.twice
|
16
|
+
mock(self).where("where clause") { mock!.order_by("order by") { mock!.limit(:per_page) { mock!.paginate({:page => :page, :per_page => :per_page}) { :answer } } } }
|
17
17
|
|
18
18
|
_find_objects(params, %w(foo bar baz), %w(foo bar)).should == :answer
|
19
19
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: data_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jason Dew
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirement: &id002 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - "="
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: 3.0.pre2
|
36
36
|
type: :runtime
|