Class: Deprecool::Finders::Rails::V7_1_0::SerializerPositionalClassArgument
- Inherits:
-
Deprecool::Finder
- Object
- Deprecool::Finder
- Deprecool::Finders::Rails::V7_1_0::SerializerPositionalClassArgument
- Defined in:
- lib/deprecool/finders/rails/v7.1.0/serializer_positional_class_argument.rb
Instance Attribute Summary
Attributes inherited from Deprecool::Finder
Instance Method Summary collapse
-
#on_call_node(node) ⇒ Object
TODO: add check for the
serializemethod being called by a Rails model?, like add a on_constant_path_node for ActiveRecord::Base or a class_node with a superclass of ActiveRecord::Base def on_class_node node node end.
Methods inherited from Deprecool::Finder
affected_version_range, classname, effort, hook_methods, id, inherited, #initialize
Methods included from PrismHelpers
#arguments_are_length, #arguments_contain, #unwrap_arguments, #unwrap_array, #unwrap_children, #unwrap_class, #unwrap_parentheses, #value_from_argument
Constructor Details
This class inherits a constructor from Deprecool::Finder
Instance Method Details
#on_call_node(node) ⇒ Object
TODO: add check for the serialize method being called by a Rails model?,
like add a on_constant_path_node for ActiveRecord::Base
or a class_node with a superclass of ActiveRecord::Base
def on_class_node node
node
end
26 27 28 29 30 31 32 |
# File 'lib/deprecool/finders/rails/v7.1.0/serializer_positional_class_argument.rb', line 26 def on_call_node(node) return unless node.name == :serialize return unless arguments_are_length(node.arguments, 2) return unless unwrap_arguments(node.arguments)[1].is_a?(Prism::ConstantReadNode) add_offense(node, confidence: :high) end |