我拼命地没有成功使Carrierwave与Tyre(Elasticsearch gem)合作。Elasticsearch轮胎Carrierwave远程上传
我有一个问题模型,它是一个ActiveRecord之一,但我用Tire将它迁移到Elasticsearch上。直到它在ActiveRecord上时,一切都很好。但现在不行了。
我想要的是将远程文件(从Facebook)上传到S3存储桶。所有的配置文件是正确的(因为它是在ActiveRecord的模式工作)
这里是我的问题型号:
class Question
include ActiveModel::MassAssignmentSecurity
include ActiveModel::Validations
extend CarrierWave::Mount
include Tire::Model::Callbacks
include Tire::Model::Persistence
# set fields for carrierwave uploader
mount_uploader :path, QuestionUploader
validates_presence_of :question
attr_accessible :path
attr_accessor :remote_path_url, :remove_path
property :difficulty
property :question
property :path
end
然后在我的questions_controller:
class QuestionsController < ApplicationController
def create
@question = Question.new question: "How are you ?", difficulty: 3
@question.remote_path_url = "http://domain.com/file.jpg"
@question.save
render nothing: true
end
end
Elasticsearch纪录的作品,但没有上传发生...
有人有想法吗?
干杯