Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9258977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:32:37+00:00 2026-06-18T12:32:37+00:00

I have my site configured so that it will automatically render different versions of

  • 0

I have my site configured so that it will automatically render different versions of a video in the background. It’s actually working really well. If the video is successful in the three different transcodes it will send a success email. However, if it generates an error, it will send a failure email. The issue that I’m having is that i’m trying to pass self through to the Action Mailer so that I can atleast give the name of the video that is successful or failed. However, it appears that self is null.

model

  def video_success(format, opts)
    VideoMailer.video_success(self).deliver
  end
  def video_rescue(format, opts)
    VideoMailer.video_error(self).deliver
  end

uploader

version :mp4 do
    process :encode_video => [:mp4, callbacks: {rescue: :video_rescue}  ]
    def full_filename(for_file)
      "#{File.basename(for_file, File.extname(for_file))}.mp4"
    end
end


version :webm do
    process :encode_video => [:webm, callbacks: { after_transcode: :video_success, rescue: :video_rescue }]
    def full_filename(for_file)
      "#{File.basename(for_file, File.extname(for_file))}.webm"
    end
end

Any thoughts on how this can be accomplished? Also, it would be best that if there was an error, to return the error message that is generated.

Secondly, each User model has an email address. The user who uploads the video should receive the email address. However, I’m having issues using current_user within the model. I’m thinking that it also has something to do with the backgrounder since that information is not passed over to the background process.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:32:39+00:00Added an answer on June 18, 2026 at 12:32 pm

    I added a class method to the end of the background processor

    process_in_background :video, ParanoidVideo

    In the models directory, I created paranoid_video.rb and referenced the delivery of the mail. This way, the Carrierwave_Backgrounder is handling the success method instead of Carrierwave-Video.

    class ParanoidVideo < ::CarrierWave::Workers::ProcessAsset
      def success(job)
        VideoMailer.video_backgrounder(job).deliver
      end
    end
    

    I ended up creating a new field in the database called last_updated_by and use this to return which user is being called. Granted, this is an extra call to the database when the user is being pulled, but I find that this is sufficient for my purposes. The background processor statically returns consistent handlers so I was able to just split the lines and gsub to get the ID. to_i will pull the first numerical value which is always the Video id in my case.

      def video_backgrounder(job)
        @job = job
        @video = Video.find_by_id(@job.handler.split("\n")[2].gsub("id: '","").to_i)
        @user = User.find_by_id(@video.last_updated_by)
        mail(:to => @user.email, :subject => "Video Transcoding Successful")
      end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have configured FBA on Sharepoint 2010 site. And its working fine when I
I have site I am working on and the images take forever to load,
For example I have site http://localhost/site In IIS I set that 404 error causes
So I have site list on certain pages that basically just have links to
I have a site that i want to redirect all requests accept for 1
I have a site that allows download or streaming of mp3 files. All the
I have a site with multiple pages, and each page has a table that
I have an ASP.NET MVC 4 site running perfectly well in an Azure WebRole.
I'm using the django_openid_auth module and have it configured to automatically create new user
I have configured multi site in my magento website. I follow the following link

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.