Skip to content
Browse files

Simplify overidden exists?

  • Loading branch information...
1 parent fac576f commit 923a087322d0be8f4594df8e935b0ae0876414f1 @norman committed Sep 3, 2011
Showing with 1 addition and 5 deletions.
  1. +1 −5 lib/friendly_id/finder_methods.rb
View
6 lib/friendly_id/finder_methods.rb
@@ -27,11 +27,7 @@ def find_one(id)
# @see FriendlyId::ObjectUtils
def exists?(id = nil)
return super if id.unfriendly_id?
- join_dependency = construct_join_dependency_for_association_find
- relation = construct_relation_for_association_find(join_dependency)
- relation = relation.except(:select).select("1").limit(1)
- relation = relation.where(@klass.friendly_id_config.query_field => id)
- connection.select_value(relation.to_sql) ? true : false
+ super @klass.friendly_id_config.query_field => id
end
end
end

0 comments on commit 923a087

Please sign in to comment.
Something went wrong with that request. Please try again.