Class: RuboCop::Cop::Rails::DateTimeConversion
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Rails::DateTimeConversion
- Defined in:
- lib/rubocop/cop/rails/date_time_conversion.rb
Constant Summary collapse
- MSG =
'Use in_time_zone(...) instead of using to_datetime.'- RESTRICT_ON_SEND =
[:to_datetime].freeze
Instance Method Summary collapse
Instance Method Details
#on_csend(node) ⇒ Object
14 15 16 17 18 |
# File 'lib/rubocop/cop/rails/date_time_conversion.rb', line 14 def on_csend(node) return unless node.method_name == :to_datetime add_offense(node) end |
#on_send(node) ⇒ Object
10 11 12 |
# File 'lib/rubocop/cop/rails/date_time_conversion.rb', line 10 def on_send(node) add_offense(node) end |