Skip to content

Commit

Permalink
Update persistence.rb
Browse files Browse the repository at this point in the history
compact is faster than looping with `reject` and achieves the same result
  • Loading branch information
RicardoTrindade authored Apr 18, 2024
1 parent 8e2ba4d commit f0e8564
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_graph/shared/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def destroyed?

# @return [Hash] all defined and none nil properties
def props
attributes.reject { |_, v| v.nil? }.symbolize_keys
attributes.compact.transform_keys(&:to_sym)
end

# @return true if the attributes hash has been frozen
Expand Down

0 comments on commit f0e8564

Please sign in to comment.