aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-23 00:57:38 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-23 00:57:38 +0000
commitd09e42cfe4b970c03402ab41e3eef95cd32fa4d3 (patch)
tree185cfecd7906c9051c35fa7a6d65644ce41f368d /activerecord/lib/active_record
parentf30b7a31bda74715c09759d03064f6f7c7c784b9 (diff)
downloadrails-d09e42cfe4b970c03402ab41e3eef95cd32fa4d3.tar.gz
rails-d09e42cfe4b970c03402ab41e3eef95cd32fa4d3.tar.bz2
rails-d09e42cfe4b970c03402ab41e3eef95cd32fa4d3.zip
Fixed that AR exists?() would explode on postgresql if the passed id did not match the PK type #900 [Scott Barron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@983 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 400f0ceb81..b3d4400138 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -330,7 +330,7 @@ module ActiveRecord #:nodoc:
# Example:
# Person.exists?(5)
def exists?(id)
- !find_first("#{primary_key} = #{sanitize(id)}").nil?
+ !find_first("#{primary_key} = #{sanitize(id)}").nil? rescue false
end
# This method is deprecated in favor of find with the :conditions option.