mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-21 18:42:29 +01:00
Move rate tasks into a namespace
This commit is contained in:
parent
09e7502d42
commit
ef70f38789
20
Rakefile
20
Rakefile
@ -4,15 +4,19 @@ require 'fixer'
|
||||
require 'rake/testtask'
|
||||
require 'db'
|
||||
|
||||
task :load do
|
||||
Currency.delete
|
||||
data = Fixer::Feed.new(:historical)
|
||||
Currency.multi_insert(data.to_a)
|
||||
end
|
||||
namespace :rates do
|
||||
desc 'Reload all rates'
|
||||
task :reload do
|
||||
Currency.delete
|
||||
data = Fixer::Feed.new(:historical)
|
||||
Currency.multi_insert(data.to_a)
|
||||
end
|
||||
|
||||
task :update do
|
||||
Fixer::Feed.new.each do |hsh|
|
||||
Currency.find_or_create(hsh)
|
||||
desc 'Update rates'
|
||||
task :update do
|
||||
Fixer::Feed.new.each do |hsh|
|
||||
Currency.find_or_create(hsh)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user