maplesyrup / maple

This is the web portion of our app
4 stars 4 forks source link

Edit posts broken #429

Open CalvinFernandez opened 11 years ago

CalvinFernandez commented 11 years ago

The picture is gone when you edit a photo

:cry: :bee: :bee:

benrudolph commented 11 years ago

noooo! haha

On Tue, Jun 4, 2013 at 10:45 AM, Calvin Fernandez notifications@github.comwrote:

The picture is gone when you edit a photo

[image: :cry:][image: :bee:][image: :bee:]

— Reply to this email directly or view it on GitHubhttps://github.com/maplesyrup/maple/issues/429 .

Ben Rudolph http://www.benrudolph.com | Stanford University B.S. Candidate 2013 | Computer Science

CalvinFernandez commented 11 years ago

hotfix just remove link lol

CalvinFernandez commented 11 years ago

Possible fix: @benrudolph I'm thinking there's a problem with the line @model.save(attributes, ... ) paperclip is hopping in here and assuming that you're trying to upload a new image and then saves nothing as the image. I'm going to try to leverage patch here

benrudolph commented 11 years ago

@CalvinFernandez hey i think i know what the bug is. it has to do with this:

https://github.com/maplesyrup/maple/blob/master/app/controllers/posts_controller.rb#L126

basically wanted to be able to set things to nil (like the campaign) but when you don't check for present and we don't send the image attribute to backbone, it assumes it's nil when it returns to the controller and then the image gets set to nil. i can fix

CalvinFernandez commented 11 years ago

@benrudolph. see #434 .

benrudolph commented 11 years ago

ok nice, how does this work when you set something to nil like the campaign id?

CalvinFernandez commented 11 years ago

dang