# frozen_string_literal: true require_relative '../../gitlab/styles/rubocop/model_helpers' module Rubocop module Cop # Cop that prevents the use of `serialize` in ActiveRecord models. class ActiveRecordSerialize < RuboCop::Cop::Cop include Gitlab::Styles::Rubocop::ModelHelpers MSG = 'Do not store serialized data in the database, use separate columns and/or tables instead' def on_send(node) return unless in_model?(node) add_offense(node, location: :selector) if node.children[1] == :serialize end end end end