Skip to content

Commit

Permalink
Merge the offset and limit back into the passed in options so the con…
Browse files Browse the repository at this point in the history
…nection adapater can see all of the options

This is mostly done to support the sqlserver adapter that looks for the order hash member to support limit and offset
  • Loading branch information
Lucas Maxwell committed Mar 16, 2011
1 parent f169dcc commit adea61b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/will_paginate/finder.rb
Expand Up @@ -133,7 +133,7 @@ def paginate_by_sql(sql, options)
query = sanitize_sql(sql.dup)
original_query = query.dup
# add limit, offset
add_limit! query, :offset => pager.offset, :limit => pager.per_page
add_limit! query, options.merge(:offset => pager.offset, :limit => pager.per_page)
# perfom the find
pager.replace find_by_sql(query)

Expand Down

0 comments on commit adea61b

Please sign in to comment.