From c3e9d4b4083343ccd91300b5a2780abab62047cf Mon Sep 17 00:00:00 2001 From: Luiz Picolo Date: Thu, 7 Oct 2021 20:38:12 -0400 Subject: [PATCH] Created rake task to save rate --- Rakefile | 5 ++++- lib/tasks/cron.rake | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 lib/tasks/cron.rake diff --git a/Rakefile b/Rakefile index 5bea21d..efa2b27 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,6 @@ require 'sinatra/activerecord' require 'sinatra/activerecord/rake' -require './app' \ No newline at end of file +require './models/rate' +require './app' + +Dir.glob('lib/tasks/*.rake').each { |r| load r} \ No newline at end of file diff --git a/lib/tasks/cron.rake b/lib/tasks/cron.rake new file mode 100644 index 0000000..7b8f1e3 --- /dev/null +++ b/lib/tasks/cron.rake @@ -0,0 +1,6 @@ +namespace :rate do + desc "create and save rate" + task :save do + Rate.save + end +end \ No newline at end of file