Skip to content

Commit

Permalink
Make use of delete_all in data= for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
davidstosik committed Oct 7, 2020
1 parent 361ca56 commit 2b5072c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/active_hash/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ def data
end

def data=(array_of_hashes)
mark_dirty
records.clear
reset_record_index
delete_all
self._data = array_of_hashes
if array_of_hashes
auto_assign_fields(array_of_hashes)
Expand Down

0 comments on commit 2b5072c

Please sign in to comment.