Class: Rubocop::Cop::ActiveRecordSerialize
- Inherits:
-
RuboCop::Cop::Base
- Object
- RuboCop::Cop::Base
- Rubocop::Cop::ActiveRecordSerialize
- Defined in:
- lib/rubocop/cop/active_record_serialize.rb
Overview
Cop that prevents the use of ‘serialize` in ActiveRecord models.
Constant Summary collapse
- MSG =
'Do not store serialized data in the database, use separate columns and/or tables instead'
- RESTRICT_ON_SEND =
%i[serialize].freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
18 19 20 21 22 |
# File 'lib/rubocop/cop/active_record_serialize.rb', line 18 def on_send(node) return if node.receiver add_offense(node.loc.selector) end |