Giter Club home page Giter Club logo

Comments (6)

jmuheim avatar jmuheim commented on September 25, 2024

I have added model specs, and in the specs, the update works as expected.

jmuheim/test-carrierwave-base64-update@bd6a409

So it seems it's not a problem on the model's level.

I will try to add feature specs, showing the problem...

from carrierwave-base64.

jmuheim avatar jmuheim commented on September 25, 2024

I added feature specs which I hoped would show the problem, but somehow it seems to work in the specs, but not in the "live" browser, see here:

https://github.com/jmuheim/test-carrierwave-base64-update/blob/master/spec/features/users_spec.rb#L48

As @nathanvda, the creator of the cocoon gem, helpfully pointed out: it seems that when only setting the base64 string to a new string and no other attribute of the nested object, no update happens. But when in addition to the base64 string another attribute of the nested object is changed, then the update happens as expected, even for the base64 string:

nathanvda/cocoon#311 (comment)

So it seems to be some problem with ActiveRecord not being notified of an attribute change when only the base64 string was changed. You can reproduce this behaviour easily in the browser:

  • Create a user with an attachment
  • Edit the user:
    • When you only set the base64 string to a new one, it won't be saved as a new image
    • When you set the base64 string to a new one and also set a new name, the name and the base64 string are saved

I have no idea why in the specs it works but not in the "live" browser. Any help fixing this problem is highly appreciated. Thanks.

from carrierwave-base64.

jmuheim avatar jmuheim commented on September 25, 2024

I'll be on holidays the next week. It would be very nice to see some progress here until then, as our application heavily depends on your gem in combination with nested attributes and cocoon.

If I can be of any help afterwards, please ask. Thank you.

from carrierwave-base64.

y9v avatar y9v commented on September 25, 2024

I will take a look in a couple of days, had no time yet
On Fri 28 Aug 2015 at 15:51 Joshua Muheim [email protected] wrote:

I'll be on holidays the next week. It would be very nice to see some
progress here until then, as our application heavily depends on your gem in
combination with nested attributes and cocoon.

If I can be of any help afterwards, please ask. Thank you.


Reply to this email directly or view it on GitHub
#16 (comment)
.

from carrierwave-base64.

jmuheim avatar jmuheim commented on September 25, 2024

It's great to hear that you're planning to take care of it. I'm very eager to know where exactly the problem lies. Be sure to take also a look at the corresponding ticket at cocoon's side:

nathanvda/cocoon#311

Best wishes.

from carrierwave-base64.

y9v avatar y9v commented on September 25, 2024

The problem was that the attribute was not marked as updated by the carrierwave gem. Your test app works as expected with the new version of carrierwave-base64.

Sorry that it took a while for me to fix it, i was on vacation the last week.

from carrierwave-base64.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.