FIX: only load S3 stuff when we need it

This commit is contained in:
Sam 2015-02-11 10:55:04 +11:00
parent 3cf87b94c9
commit 577f7446b4
1 changed files with 2 additions and 4 deletions

View File

@ -1,5 +1,3 @@
require "s3_helper"
class Backup class Backup
include UrlHelper include UrlHelper
include ActiveModel::SerializerSupport include ActiveModel::SerializerSupport
@ -47,8 +45,8 @@ class Backup
end end
def s3 def s3
return @s3_helper if @s3_helper require "s3_helper" unless defined? S3Helper
@s3_helper = S3Helper.new(s3_bucket) @s3_helper ||= S3Helper.new(s3_bucket)
end end
def upload_to_s3 def upload_to_s3