Skip to content

Commit 8ac1f10

Browse files
committed
Remove unnecessary dup in ActiveModel::Serializer::Associations#associate
The `_reflections` are duped on `inherited` - no need to `dup` them with each addition.
1 parent 34e5faa commit 8ac1f10

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/active_model/serializer/associations.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ def has_one(name, options = {}, &block)
7676
# @api private
7777
#
7878
def associate(reflection)
79-
self._reflections = _reflections.dup
80-
8179
self._reflections << reflection
8280
end
8381
end

0 commit comments

Comments
 (0)