aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-11-25 16:11:53 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-25 17:33:38 -0200
commitac6e9447e521a6ab2e3b60acd00a1ae2b863329e (patch)
treebef45ec019a8cb6d17e8beb98c706eff95f4d467 /activerecord
parent1b6b80355c52cc97d96f6d747271ff43efebab0a (diff)
downloadrails-ac6e9447e521a6ab2e3b60acd00a1ae2b863329e.tar.gz
rails-ac6e9447e521a6ab2e3b60acd00a1ae2b863329e.tar.bz2
rails-ac6e9447e521a6ab2e3b60acd00a1ae2b863329e.zip
Remove return, we are already returning self.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/association_collection.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb
index 774103342a..8a98c0fcbe 100644
--- a/activerecord/lib/active_record/associations/association_collection.rb
+++ b/activerecord/lib/active_record/associations/association_collection.rb
@@ -235,12 +235,12 @@ module ActiveRecord
# Removes all records from this association. Returns +self+ so method calls may be chained.
def clear
- return self if length.zero? # forces load_target if it hasn't happened already
-
- if @reflection.options[:dependent] && @reflection.options[:dependent] == :destroy
- destroy_all
- else
- delete_all
+ unless length.zero? # forces load_target if it hasn't happened already
+ if @reflection.options[:dependent] && @reflection.options[:dependent] == :destroy
+ destroy_all
+ else
+ delete_all
+ end
end
self