Skip to content

Commit

Permalink
updated rake task to proper names and removed uneeded update_attribut…
Browse files Browse the repository at this point in the history
…e statement
  • Loading branch information
zeknox committed Jan 28, 2014
1 parent b0e3283 commit 621b4e0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/tasks/templates.rake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace :templates do
task update: :environment do
t = Template.where(name: 'New Intel Password Checker').first
t = Template.where(name: 'Intel Password Checker').first
unless t.attachments.size > 0
t.update_attribute(directory_index: 'index.php')
a = t.attachments.create(function: 'website')
Expand All @@ -17,7 +17,7 @@ namespace :templates do
a.save!
end

t = Template.where(name: 'New Efax').first
t = Template.where(name: 'Efax').first
unless t.attachments.size > 0
t.update_attribute(directory_index: 'index.php')
a = t.attachments.create(function: 'website')
Expand All @@ -33,8 +33,7 @@ namespace :templates do
end

task load: :environment do
t = Template.create(name: 'New Intel Password Checker', directory_index: 'index.php', description: 'Users test the strength of their password')
t.update_attribute(directory_index: 'index.php')
t = Template.create(name: 'Intel Password Checker', directory_index: 'index.php', description: 'Users test the strength of their password')
a = t.attachments.create(function: 'website')
a.file = File.open("#{Rails.root}/vendor/templates/intel/index.php")
a.save!
Expand All @@ -47,7 +46,7 @@ namespace :templates do
a = t.attachments.create(function: 'attachment')
a.file = File.open("#{Rails.root}/vendor/templates/intel/intel.jpg")
a.save!
t = Template.create(name: 'New Efax', directory_index: 'index.php', description: 'User received a efax which requires them to open the PDF')
t = Template.create(name: 'Efax', directory_index: 'index.php', description: 'User received a efax which requires them to open the PDF')
a.file = File.open("#{Rails.root}/vendor/templates/efax/index.php")
a.save!
a = t.attachments.create(function: 'email')
Expand Down

0 comments on commit 621b4e0

Please sign in to comment.