diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-11-25 16:12:30 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-11-25 17:35:09 -0200 |
commit | c91a13f8f557cc1d21fccb5f964d50438cd60a52 (patch) | |
tree | c919e53291b7ac8b6295fa33e25e05952d55fbf9 /activerecord/lib/active_record/associations | |
parent | ac6e9447e521a6ab2e3b60acd00a1ae2b863329e (diff) | |
download | rails-c91a13f8f557cc1d21fccb5f964d50438cd60a52.tar.gz rails-c91a13f8f557cc1d21fccb5f964d50438cd60a52.tar.bz2 rails-c91a13f8f557cc1d21fccb5f964d50438cd60a52.zip |
Use ternary instead explicit return.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 8a98c0fcbe..e4e5ffd2b3 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -357,8 +357,7 @@ module ActiveRecord 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) |