Since the created_at
time field of the tweet has been frozen, you can't modify it, so utc
will raise the Exception
, because it tries to change value of self
. Instead of modification you shell to duplicate the variable and reassign it:
@tweet.created_at = @tweet.created_at.dup.utc