Skip to content

Commit

Permalink
Merge pull request #26453 from kamipo/remove_unused_internal_dependen…
Browse files Browse the repository at this point in the history
…t_option

Remove unused internal `:dependent` option in `CollectionAssociation#delete`
  • Loading branch information
sgrif committed Nov 1, 2016
2 parents c7adc61 + 5f9051c commit 8632efd
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -192,11 +192,8 @@ def destroy_all
# +delete_records+. They are in any case removed from the collection.
def delete(*records)
return if records.empty?
_options = records.extract_options!
dependent = _options[:dependent] || options[:dependent]

records = find(records) if records.any? { |record| record.kind_of?(Integer) || record.kind_of?(String) }
delete_or_destroy(records, dependent)
delete_or_destroy(records, options[:dependent])
end

# Deletes the +records+ and removes them from this association calling
Expand Down

0 comments on commit 8632efd

Please sign in to comment.