Skip to content

Commit

Permalink
[Fixes#86249632] Sets default ui_logo to point to S3 instead of a loc…
Browse files Browse the repository at this point in the history
…al file.
  • Loading branch information
DerekEdwards committed Jan 15, 2015
1 parent 1221672 commit b0bfae1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions db/common_seeds.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include SeedsHelpers
include Rake


### Non Internationlized Records ###

Expand Down Expand Up @@ -238,3 +240,8 @@
WalkingMaximumDistance.where(value: 2, is_default: true).first_or_create!
WalkingMaximumDistance.where(value: 3).first_or_create!
WalkingMaximumDistance.where(value: 4).first_or_create!

#Run additional Rake Tasks
Oneclick::Application.load_tasks
Rake::Task['oneclick:set_default_logo'].invoke
Rake::Task['oneclick:set_mode_icons'].invoke
13 changes: 13 additions & 0 deletions lib/tasks/oneclick.rake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ namespace :oneclick do
end
end

desc "Sets default logo"
task :set_default_logo=> :environment do
bucket = ENV['AWS_BUCKET'].nil? ? "oneclick-#{Oneclick::Application.config.brand}" : ENV['AWS_BUCKET']
full_url = "https://s3.amazonaws.com/#{bucket}/images/logo.png"
puts "----------------------------"
puts full_url
puts "----------------------------"

oc = OneclickConfiguration.first_or_create(code: "ui_logo")
oc.value = full_url
oc.save
end

task :seed_data => :environment do
throw Exception.new("*** Deprecated, just use db:seed task ***")
end
Expand Down

0 comments on commit b0bfae1

Please sign in to comment.