
Support a negation of symbolic finder operators
Reported by Sheldon Hearn | July 22nd, 2009 @ 04:14 AM
Specifically, I would like my DM finder to leverage the SQL "NOT LIKE" operator.
This could be implemented with a new symbolic operator "not_like", e.g.
User.all :login.not_like => "%.%" # Users without dots in their login
But it might be nicer to allow the not symbolic operator to be applied to others, e.g.
User.all :login.not.like => "%.%"
This idea started as a question in the Google Group:
http://groups.google.com/group/datamapper/browse_thread/thread/5ec8...
Ciao,
Sheldon.
Comments and changes to this ticket
-
Sheldon Hearn July 22nd, 2009 @ 01:13 PM
Indeed. And case insensitivity would be nice for more than just LIKE.
E.g.
User.first :email.eql.ignore_case => 'sheldonh@starjuice.net'
Most likely, this more general support would make it possible to emulate the non-standard ILIKE. The above could translate to
SELECT ... FROM users WHERE LOWER(email) = ?
where the value bound to the placeholder would be downcased in Ruby.
But doesn't that deserve its own separate issue?
Ciao,
Sheldon. -
Dan Kubb (dkubb) July 22nd, 2009 @ 01:26 PM
- State changed from new to suggestion
- Milestone cleared.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »