NoMethodError in TweetsController#create undefined method `publish_at' for nil:NilClass
I am new at rails and just complete Chris tutorial in gorails.com => schedule_tweets. But I could not send any tweet , I did the UTC modification for america/brasilia, when I make a schedule tweet this error is showed in my screen. I am lost. How could I try to fix it ?
after_save_commit do
if publish_at_previously_changed?
TweetJob.set(wait_until: @tweet.publish_at).perform_later(self)
end
end
Rails.root: /home/adalberto/Documents/railsForBeginners/scheduled_tweets
Application Trace | Framework Trace | Full Trace
app/models/tweet.rb:16:in block in <class:Tweet>'
create'
app/controllers/tweets_controller.rb:15:in
Request
Parameters:
{"authenticity_token"=>"[FILTERED]",
"tweet"=>{"twitter_account_id"=>"3", "body"=>"hello", "publish_at(1i)"=>"2021", "publish_at(2i)"=>"2", "publish_at(3i)"=>"18", "publish_at(4i)"=>"20", "publish_at(5i)"=>"21"},
"button"=>""}