class RuboCop::Cop::Salsify::RailsApplicationSerializer
Check that serializers subclass ApplicationSerializer with Rails 5.0.
@example
# good class Tesla < ApplicationSerializer ... end # bad class Yugo < ActiveModel::Serializer ... end
Constants
- BASE_PATTERN
- MSG
- SUPERCLASS
Public Instance Methods
Source
# File lib/rubocop/cop/salsify/rails_application_serializer.rb, line 31 def autocorrect(node) lambda do |corrector| corrector.replace(node.source_range, self.class::SUPERCLASS) end end