This project is archived and is in readonly mode.
<Model>.offset(x).limit(x) unknown offset method exception
Reported by vhochstein | September 23rd, 2010 @ 09:04 AM
run rails console
Type:
Team.offset(1).limit(1)
call will fail
Team.limit(1).offset(1) works great.
Reason for this is in my opinion a missing delegate call for
:offset in ActiveRecord Base:
delegate :select, :group, :order, :reorder, :limit, :joins, :where,
:preload, :eager_load, :includes, :from, :lock, :readonly, :having,
:create_with, :to => :scoped
Comments and changes to this ticket
-
David Trasbo September 23rd, 2010 @ 09:29 AM
- State changed from new to open
- Importance changed from to Low
-
Marcelo Giorgi September 23rd, 2010 @ 11:22 PM
- Tag set to activerecord, patched, scope
Hi vhochstein,
Yeah, I totally agree, it should behave in the same way as #limit.
Here I provide a couple of tests and a patch for this case based on your suggestion.
BTW: This patch applies cleanly on master right now.
Any thoughts?
-
Repository September 25th, 2010 @ 12:25 AM
- State changed from open to resolved
(from [72543b2e6358a502257a0e1eac61b0e3164937dd]) Delegate ActiveRecord::Base.offset to scoped methods (analogous to limit) [#5688 state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/72543b2e6358a502257a0e1eac61b0... -
Repository September 25th, 2010 @ 12:25 AM
(from [23f728abd5209728114fe4722329fbf860a814ca]) Delegate ActiveRecord::Base.offset to scoped methods (analogous to limit) [#5688 state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/23f728abd5209728114fe4722329fb... -
Andrea Campi October 11th, 2010 @ 07:23 AM
- Tag changed from activerecord, patched, scope to activerecord, patch, scope
bulk tags cleanup
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 5688 <Model>.offset(x).limit(x) unknown offset method exception (from [72543b2e6358a502257a0e1eac61b0e3164937dd]) Delegat...
- 5688 <Model>.offset(x).limit(x) unknown offset method exception (from [23f728abd5209728114fe4722329fbf860a814ca]) Delegat...