Class: RuboCop::Cop::Rails::DateTimeCurrent

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/rails/date_time_current.rb

Constant Summary collapse

MSG =
'Use Time.current instead of DateTime.current.'
RESTRICT_ON_SEND =
[:current].freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



15
16
17
18
19
# File 'lib/rubocop/cop/rails/date_time_current.rb', line 15

def on_send(node)
  return unless datetime_curent_usage(node)

  add_offense(node)
end