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 Mar 5, 2020
1 parent cf523a4 commit d92f283
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 @@ -108,9 +108,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 d92f283

Please sign in to comment.