File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,27 @@ module ActiveModelSerializers
9
9
10
10
module_function
11
11
12
+ # @note
13
+ # ```ruby
14
+ # private
15
+ #
16
+ # attr_reader :resource, :adapter_opts, :serializer_opts
17
+ # ```
18
+ #
19
+ # Will generate a warning, though it shouldn't.
20
+ # There's a bug in Ruby for this: https://bugs.ruby-lang.org/issues/10967
21
+ #
22
+ # We can use +ActiveModelSerializers.silence_warnings+ as a
23
+ # 'safety valve' for unfixable or not-worth-fixing warnings,
24
+ # and keep our app warning-free.
25
+ #
26
+ # ```ruby
27
+ # private
28
+ #
29
+ # ActiveModelSerializers.silence_warnings do
30
+ # attr_reader :resource, :adapter_opts, :serializer_opts
31
+ # end
32
+ # ```
12
33
def silence_warnings
13
34
verbose = $VERBOSE
14
35
$VERBOSE = nil
You can’t perform that action at this time.
0 commit comments