Skip to content

Commit

Permalink
Don't need to transform_values to avoid capturing the record referenc…
Browse files Browse the repository at this point in the history
…e I don't think
  • Loading branch information
kaspth committed Jan 9, 2025
1 parent c81d9a5 commit c3f15be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/oaken/stored/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def upsert(label = nil, unique_by: nil, **attributes)
#
# Note: `users.method(:someone).source_location` also points back to the file and line of the `label` call.
def label(**labels)
labels.transform_values(&:id).each { _label _1, _2 }
labels.each { |name, record| _label name, record.id }
end

private def _label(name, id)
Expand Down

0 comments on commit c3f15be

Please sign in to comment.