Permalink
Browse files

Adding an overridable default_pagination_options method

  • Loading branch information...
1 parent 1866d0f commit ca28577d396a34779eafc16a5d79282dbc025fd2 @vicentemundim committed Mar 19, 2011
Showing with 7 additions and 3 deletions.
  1. +1 −1 Gemfile.lock
  2. +5 −1 lib/mongoid/query_string_interface.rb
  3. +1 −1 lib/version.rb
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- mongoid_query_string_interface (0.2.0)
+ mongoid_query_string_interface (0.2.2)
json (>= 1.4.6)
mongoid (~> 2.0.0.rc)
@@ -54,9 +54,13 @@ def default_sorting_options
[]
end
+ def default_pagination_options
+ { :per_page => 12, :page => 1 }
+ end
+
private
def pagination_options(options)
- options.reverse_merge :per_page => 12, :page => 1
+ options.reverse_merge default_pagination_options
end
def filtering_options(options)
View
@@ -1,6 +1,6 @@
# encoding: utf-8
module Mongoid #:nodoc
module QueryStringInterface #:nodoc
- VERSION = "0.2.0"
+ VERSION = "0.2.2"
end
end

0 comments on commit ca28577

Please sign in to comment.