mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Comment private accessor warnings
This commit is contained in:
parent
61c54bddcd
commit
c9ae868bfb
@ -9,6 +9,27 @@ module ActiveModelSerializers
|
||||
|
||||
module_function
|
||||
|
||||
# @note
|
||||
# ```ruby
|
||||
# private
|
||||
#
|
||||
# attr_reader :resource, :adapter_opts, :serializer_opts
|
||||
# ```
|
||||
#
|
||||
# Will generate a warning, though it shouldn't.
|
||||
# There's a bug in Ruby for this: https://bugs.ruby-lang.org/issues/10967
|
||||
#
|
||||
# We can use +ActiveModelSerializers.silence_warnings+ as a
|
||||
# 'safety valve' for unfixable or not-worth-fixing warnings,
|
||||
# and keep our app warning-free.
|
||||
#
|
||||
# ```ruby
|
||||
# private
|
||||
#
|
||||
# ActiveModelSerializers.silence_warnings do
|
||||
# attr_reader :resource, :adapter_opts, :serializer_opts
|
||||
# end
|
||||
# ```
|
||||
def silence_warnings
|
||||
verbose = $VERBOSE
|
||||
$VERBOSE = nil
|
||||
|
||||
Loading…
Reference in New Issue
Block a user