Skip to content

Commit

Permalink
Rename seed.rb to seeds.rb to work, and make trekk sourching work thr…
Browse files Browse the repository at this point in the history
…u permission issues
  • Loading branch information
paalvibe committed Jul 7, 2014
1 parent 46b6270 commit 924703e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
@@ -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?
Expand All @@ -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 <<EOS
Expand Down

0 comments on commit 924703e

Please sign in to comment.