From 924703ea94f2456f9dd3360f3d51e53cc9b364d2 Mon Sep 17 00:00:00 2001 From: Paal de Vibe Date: Mon, 7 Jul 2014 15:56:10 +0200 Subject: [PATCH] Rename seed.rb to seeds.rb to work, and make trekk sourching work thru permission issues --- db/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 40a3025..08f8675 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,6 +1,5 @@ puts "Seeding db.." ActiveRecord::Base.transaction do - Role.create!(:name => "user") if Role.find_by_name("user").nil? Role.create!(:name => "accountant") if Role.find_by_name("accountant").nil? Role.create!(:name => "employee") if Role.find_by_name("employee").nil? @@ -11,6 +10,7 @@ if TaxRate.find(:first, :conditions => {:year => 2010}).nil? puts "importing 2010 tax rates" `cp "#{Rails.root}/db/skattetrekk2010.txt" "/tmp/trekk2010.txt"` + `sudo chmod a+r "/tmp/trekk2010.txt"` TaxRate.connection.execute "create temporary table trekk2010 (val char(16)) on commit drop;" TaxRate.connection.execute "copy trekk2010 from '/tmp/trekk2010.txt';" TaxRate.connection.execute <