fixes to ad code
This commit is contained in:
@@ -25,11 +25,15 @@ class Advertisement < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def image_url
|
||||
"/images/advertisements/#{file_name}"
|
||||
"/images/advertisements/ads-#{date_prefix}/#{file_name}"
|
||||
end
|
||||
|
||||
def date_prefix
|
||||
created_at.strftime("%Y%m%d")
|
||||
end
|
||||
|
||||
def image_path
|
||||
"#{Rails.root}/public/images/advertisements/#{file_name}"
|
||||
"#{Danbooru.config.advertisement_path}/ads-#{date-prefix}/#{file_name}"
|
||||
end
|
||||
|
||||
def file
|
||||
|
||||
@@ -87,6 +87,11 @@ module Danbooru
|
||||
nil
|
||||
end
|
||||
|
||||
# Where the ad banners are stored in the file system
|
||||
def advertisement_path
|
||||
nil
|
||||
end
|
||||
|
||||
# List of memcached servers
|
||||
def memcached_servers
|
||||
%w(localhost:11211)
|
||||
|
||||
@@ -50,6 +50,12 @@ namespace :data do
|
||||
task :link_directories do
|
||||
run "rm -f #{release_path}/public/data"
|
||||
run "ln -s #{deploy_to}/shared/data #{release_path}/public/data"
|
||||
|
||||
run "rm -f #{release_path}/public/ssd"
|
||||
run "ln -s /mnt/ssd#{release_path}/public #{release_path}/public/ssd"
|
||||
|
||||
run "rm -f #{release_path}/public/images/advertisements"
|
||||
run "ln -s #{deploy_to}/shared/advertisements #{release_path}/public/images/advertisements"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user