From b9ac6140571376cff0181df6970592e401967734 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Fri, 23 Oct 2015 23:09:14 +0800 Subject: [PATCH] asset_path doesn't work in models --- app/models/map.rb | 2 +- app/models/user.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/map.rb b/app/models/map.rb index 6d2a3332..eab88814 100644 --- a/app/models/map.rb +++ b/app/models/map.rb @@ -12,7 +12,7 @@ class Map < ActiveRecord::Base :thumb => ['188x126#', :png] #:full => ['940x630#', :png] }, - :default_url => asset_path('missing-map.png') + :default_url => ActionController::Base.helpers.asset_path('missing-map.png') # Validate the attached image is image/jpg, image/png, etc validates_attachment_content_type :screenshot, :content_type => /\Aimage\/.*\Z/ diff --git a/app/models/user.rb b/app/models/user.rb index eb69829d..effa6ec5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -35,7 +35,7 @@ class User < ActiveRecord::Base :ninetysix => ['96x96#', :png], :onetwentyeight => ['128x128#', :png] }, - :default_url => asset_path('user.png') + :default_url => ActionController::Base.helpers.asset_path('user.png') # Validate the attached image is image/jpg, image/png, etc validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/