fixes #2138
This commit is contained in:
@@ -38,7 +38,7 @@ class UploadsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@upload = Upload.create(params[:upload].merge(:server => Socket.gethostname))
|
@upload = Upload.create(params[:upload].merge(:server => Socket.gethostname))
|
||||||
@upload.process! if @upload.errors.empty?
|
@upload.process! if @upload.errors.empty?
|
||||||
respond_with(@upload)
|
respond_with(@upload)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Upload < ActiveRecord::Base
|
|||||||
after_destroy :delete_temp_file
|
after_destroy :delete_temp_file
|
||||||
validate :uploader_is_not_limited, :on => :create
|
validate :uploader_is_not_limited, :on => :create
|
||||||
validate :file_or_source_is_present, :on => :create
|
validate :file_or_source_is_present, :on => :create
|
||||||
attr_accessible :file, :image_width, :image_height, :file_ext, :md5, :file_size, :as_pending, :source, :file_path, :content_type, :rating, :tag_string, :status, :backtrace, :post_id, :md5_confirmation
|
attr_accessible :file, :image_width, :image_height, :file_ext, :md5, :file_size, :as_pending, :source, :file_path, :content_type, :rating, :tag_string, :status, :backtrace, :post_id, :md5_confirmation, :parent_id
|
||||||
|
|
||||||
module ValidationMethods
|
module ValidationMethods
|
||||||
def uploader_is_not_limited
|
def uploader_is_not_limited
|
||||||
|
|||||||
Reference in New Issue
Block a user