Bugs: Browse | Submit New | Admin

[#14200] find_by_sql doesn't hit the cache as often as it could

Date:
2007-09-24 21:51
Priority:
3
Submitted By:
Nathan Wilmes (nwilmes)
Assigned To:
Eric Hodel (drbrain)
Category:
cached_model
State:
Open
Summary:
find_by_sql doesn't hit the cache as often as it could

Detailed description
If finder SQL puts backticks around the primary key, or if the 'LIMIT 1' clause is not included in the finder SQL, then
CachedModel 1.3.1 doesn't hit the cache.  Changing the regex to the line below would fix these problems.


return super unless args.first =~ /^SELECT \* FROM #{table_name} WHERE \(#{table_name}\.`?#{primary_key}`? = '?(\d+)'?\)(
+LIMIT 1)? *$/

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item