Skip to content

Commit 76777b6

Browse files
committed
Use marginally more efficient call to fetch by moving default to a block
1 parent 3a02ef8 commit 76777b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_model/serializer/adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def meta_key
7575
end
7676

7777
def root
78-
@options.fetch(:root, serializer.json_key)
78+
@options.fetch(:root) { serializer.json_key }
7979
end
8080

8181
def include_meta(json)

0 commit comments

Comments
 (0)