Skip to content

Commit 31489b8

Browse files
committed
ActiveRecordWrapper limit should default to 100, as doc'd
Too hard to figure out an automated test for this right now, but I did manually confirm
1 parent 1886646 commit 31489b8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/oai/provider.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@
146146
# * `timestamp_field` - Specifies the model field to use as the update
147147
# filter. Defaults to `updated_at`.
148148
# * `limit` - Maximum number of records to return in each page/set.
149-
# Defaults to 100.
150-
# The wrapper will paginate the result via resumption tokens.
149+
# Defaults to 100, set to `nil` for all records in one page. Otherwise
150+
# the wrapper will paginate the result via resumption tokens.
151151
# _Caution: specifying too large a limit will adversely affect performance._
152152
#
153153
# Mapping from a ActiveRecord object to a specific metadata format follows

lib/oai/provider/model/activerecord_wrapper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ActiveRecordWrapper < Model
1515
def initialize(model, options={})
1616
@model = model
1717
@timestamp_field = options.delete(:timestamp_field) || 'updated_at'
18-
@limit = options.delete(:limit)
18+
@limit = options.delete(:limit) || 100
1919

2020
unless options.empty?
2121
raise ArgumentError.new(

0 commit comments

Comments
 (0)