diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-20 21:56:50 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-20 21:56:50 +0000 |
commit | ee8d110068e958b400987b5f224e14e292fd0558 (patch) | |
tree | a94385c7b5cddb6704d2e6d53aa8097bd5363198 /activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | |
parent | 9fe45f31ebeb772fdd1bc850c12cd465463e2ef7 (diff) | |
download | rails-ee8d110068e958b400987b5f224e14e292fd0558.tar.gz rails-ee8d110068e958b400987b5f224e14e292fd0558.tar.bz2 rails-ee8d110068e958b400987b5f224e14e292fd0558.zip |
Added adapter independent limit clause as a two-element array with the first being the limit, the second being the offset #795 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@944 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql_adapter.rb')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index fd730a12dc..57f3b6f5e9 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -172,7 +172,11 @@ module ActiveRecord structure += select_one("SHOW CREATE TABLE #{table.to_a.first.last}")["Create Table"] + ";\n\n" end end - + + def add_limit_with_offset!(sql, limit, offset) + sql << " LIMIT #{offset}, #{limit}" + end + def recreate_database(name) drop_database(name) create_database(name) |