Class: RuboCop::Cop::Rails::AutoTimeDefinition
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Rails::AutoTimeDefinition
- Defined in:
- lib/rubocop/cop/deprecated/auto_time_definition.rb
Constant Summary collapse
- MSG =
'Use autotime(...) helper instead of using Date, DateTime or Time.'- RESTRICT_ON_SEND =
[:new, :today, :now].freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/rubocop/cop/deprecated/auto_time_definition.rb', line 15 def on_send(node) return unless node.source_range.source_buffer.name.include?('_spec.rb') return unless datetime_usage(node) add_offense(node) end |