This project is archived and is in readonly mode.
Fix NamedScope's delegation regex
Reported by Jan De Poorter | August 25th, 2008 @ 11:42 AM | in 2.x
NamedScope's regex is currently defined as
*snip* ...empty?|any?|respond_to?...
which breaks Object.scope.rand
I changed it to ...empty\?|any\?|respond_to\?...
Which fixes the problem. Maybe the regular expression needs to be more precise in everything though..
Comments and changes to this ticket
-
Ryan Bates August 25th, 2008 @ 03:57 PM
+1, I also think this regular expression as a whole needs to be improved or replaced with something better. But I'm not sure what that is. Any ideas?
One possible fix for some of these problems is to put the ^ and $ outside of the parenthesis:
/^(__.+|nil\?|send|object_id|...)$/
But that may change some of the intended behavior.
-
Repository August 29th, 2008 @ 02:11 PM
- State changed from new to resolved
(from [db116a2ed688d36570f412a42e9fc33dcbca56c7]) Fix NamedScope regex so methods containing "an" get delegated to proxy_found. [#901 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
-
Repository August 29th, 2008 @ 02:25 PM
- State changed from resolved to committed
(from [c37900138c565f7dacbbfbe20f9c397da7ec49c4]) Fix NamedScope regex so methods containing "an" get delegated to proxy_found
Signed-off-by: Michael Koziarski michael@koziarski.com [#901 state:committed]
Conflicts:
activerecord/lib/active_record/named_scope.rb
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
Referenced by
- 901 Fix NamedScope's delegation regex (from [db116a2ed688d36570f412a42e9fc33dcbca56c7]) Fix Nam...
- 901 Fix NamedScope's delegation regex Signed-off-by: Michael Koziarski michael@koziarski.com [#...