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 8777401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:16:15+00:00 2026-06-13T19:16:15+00:00

Looks like it’s a known issue but i’m not able to find any solution

  • 0

Looks like it’s a known issue but i’m not able to find any solution nor any dirty fix to make it working. The thing is i’m not able to remove attachments uploaded using Carrierwave plugin.

I’m using a special form field called :remove_avatar which should remove a avatar file and clear avatar column but the only thing it does is deleting the file, the file reference in avatar column still exists.

I was trying to remove it in any possible way but without a luck.

update_attributes

using u.update_attributes( :avatar => "" ) is not removing the reference

save()

u = User.find(int)
u.avatar = ""
u.save

is also not removing the reference

remove_avatar = true

u.remove_avatar = true
u.save

not working

remove_avatar!

u.remove_avatar!
u.save

not working

f.check_box :remove_avatar

not working

By ‘not working’ i mean that the file is removed from filesystem but the reference persists.

Cany you please provide me ANY tip i can use to make it working again? It can be something dirty, this bug shown a day before my deadline and i feel quite desperate. Thanks in advance.

Ruby: 1.8.7
Rails: 3.2.6
Carrierwave: master branch from git repo

  • 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-13T19:16:16+00:00Added an answer on June 13, 2026 at 7:16 pm

    According to this thread, you can probably manage this by using update_column instead of update_attribute, and then (for reasons not currently clear to me), really forcing a reload of the in-memory object (instead of just calling reload on it):

    u = User.where('avatar is not null').last # Get a user with an avatar
    u.update_column(:avatar, nil) # Use update_column to avoid callbacks
    u = User.where(:id => u).first # Force a reload of the object. No, u.reload doesn't work. No, I don't know why.
    

    When I do this in my console, u.avatar is finally blank.
    My version info, in case this doesn’t work for you: Ruby 1.9.3, Rails 3.2.2, PostgreSQL 9.2, CarrierWave 0.5.7

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looks like the following Ellipse in ControlTemplate does not get the BorderThickness, but why?
Looks like this gets me close, but (a) not quite (see below), and (b)
Looks like I didn't set up my actor correctly, but not sure how else
Looks like its related to NSURLConnection, but not sure how I can diagnose? Exception
Looks like a silly question but I am really stuck and any help would
looks like DataTable.Rows property is not saved in ViewState but the Columns property is,
Update : Looks like the query does not throw any timeout. The connection is
Looks like others have had this problem but I can't seem to find a
looks like symfony2 classloader does not allow different paths for namespaces, anyone has any
Looks like this question has been asked thousand times already, but each person's configuration

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.