This project is archived and is in readonly mode.
Simpler AR#exists?
-
Frederick Cheung
- Tag changed from activerecord, edge, patch, tested, tiny to activerecord, edge, patch, test, tested
Have your done any benchmarks to quantify the difference?
-
Roman Le Négrate
@Frederick Cheung No I haven't done any benchmark since performance improvement isn't the primary intent, but rather just a likely bonus.
-
Pratik
- State changed from new to invalid
- Assigned user set to Pratik
Don't really see much benefit in this. But if you could verify that this will work on all the different databases, don't see any harm.
Thanks.
-
Pratik
- State changed from invalid to wontfix
-
fearless_fool
- Importance changed from to
A reason to implement @Roman Le Négrate's change is that it would allow exists?() to work on tables that lack a PK. See also ticket #615 ActiveRecord exists? won't work with keyless tables.