Skip to content
Browse files

Use ternary instead explicit return.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
1 parent ac6e944 commit c91a13f8f557cc1d21fccb5f964d50438cd60a52 @miloops miloops committed with spastorino
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/associations/association_collection.rb
View
3 activerecord/lib/active_record/associations/association_collection.rb
@@ -357,8 +357,7 @@ def include?(record)
return false unless record.is_a?(@reflection.klass)
return include_in_memory?(record) unless record.persisted?
load_target if @reflection.options[:finder_sql] && !loaded?
- return @target.include?(record) if loaded?
- exists?(record)
+ loaded? ? @target.include?(record) : exists?(record)
end
def proxy_respond_to?(method, include_private = false)

0 comments on commit c91a13f

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