class RuboCop::Cop::Rails::TimeZoneAssignment
end
Time.use_zone(‘EST’) do
# good
Time.zone = ‘EST’
# bad
@example
It eliminates the possibility of a ‘zone` sticking around longer than intended.
Using `Time.use_zone` ensures the code passed in the block is the only place Time.zone is affected.
unexpected behavior at a later time.
The `zone` attribute persists for the rest of the Ruby runtime, potentially causing
Checks for the use of `Time.zone=` method.
def on_send(node)
def on_send(node) return unless time_zone_assignment?(node) add_offense(node) end