I have written this method in my model :-
class Message < ActiveRecord::Base
def self.create_message
ShortMessage.create(message: "cron job")
puts "created"
end
end
And then I updated schedule.rb file :-
every 1.minute do
runner "Message.create_message", :environment => "development"
end
And finally executed all this cammands :-
whenever --update-crontab
tail -f /var/log/syslog | grep CRON
But nothing is created in my database, when checked from console ShortMessage.last