projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8293ba
)
Work around the fact that exists? no longer works for models with
author
Tom Hughes
<tom@compton.nu>
Sat, 7 Jun 2008 22:40:39 +0000
(22:40 +0000)
committer
Tom Hughes
<tom@compton.nu>
Sat, 7 Jun 2008 22:40:39 +0000
(22:40 +0000)
no primary key.
app/models/trace.rb
patch
|
blob
|
history
diff --git
a/app/models/trace.rb
b/app/models/trace.rb
index 0e9e7bcc1598df1ffd54f447f18afa75d6fbae1a..d28c2c6f42f98a1bf6bff40b769c9707b0e71515 100644
(file)
--- a/
app/models/trace.rb
+++ b/
app/models/trace.rb
@@
-183,7
+183,7
@@
class Trace < ActiveRecord::Base
# If there are any existing points for this trace then delete
# them - we check for existing points first to avoid locking
# the table in the common case where there aren't any.
- if Tracepoint.
exists?(
['gpx_id = ?', self.id])
+ if Tracepoint.
find(:first, :conditions =>
['gpx_id = ?', self.id])
Tracepoint.delete_all(['gpx_id = ?', self.id])
end