I'm desperately don't success to make Carrierwave working with Tire (Elasticsearch gem).
I have a Question model which was an ActiveRecord one, but I migrated it on Elasticsearch with Tire. Until it was on ActiveRecord everything was working great. But not anymore.
What I want is to upload a remote file (from Facebook) to a S3 bucket. All config files are correct (as it was working under ActiveRecord model)
Here is my Question model:
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
And then in my 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 record works, but no upload happens...
Someone has an idea ?
Cheers