Coder Social home page Coder Social logo

Comments (6)

arusa avatar arusa commented on May 20, 2024

I successfully implemented this gem, but when I wrote my tests I realized the same error message when destroying objects:

ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column mobility_text_translations.record does not exist
LINE 1: ...ations".* FROM "mobility_text_translations" WHERE "mobility_...

from mobility-actiontext.

francescob avatar francescob commented on May 20, 2024

I ended up adding that record column on mobility_text_translations table, it's completely useless, but at least it works

from mobility-actiontext.

sedubois avatar sedubois commented on May 20, 2024

Indeed the Action Text backend is an extension of the Key-Value backend. Also see info in the README implementation note. I haven't needed to delete such records in my app yet, so it's quite possible there are bugs. Don't hesitate to propose a PR with tests!

This is the code in Mobility:
https://github.com/shioyama/mobility/blob/687726d4bab774067da29efc7ade311a71260dcb/lib/mobility/backends/active_record/key_value.rb#L194-L200

It was written by @shioyama in this PR. @shioyama any idea why it's [translation_class, *Mobility::Backends::ActiveRecord::KeyValue::Translation.descendants].uniq? In the case of Action Text should it not be something like [translation_class, *translation_class.descendants].uniq?

from mobility-actiontext.

vutran0111 avatar vutran0111 commented on May 20, 2024

I got the same problem, can you guys have a solution for this case?

from mobility-actiontext.

shioyama avatar shioyama commented on May 20, 2024

The reason it's *Mobility::Backends::ActiveRecord::KeyValue::Translation.descendants].uniq is so that if you define your own translation classes subclassing Mobility::Backends::ActiveRecord::KeyValue::Translation, e.g. a translation class for an integer translation, it would still correctly destroy those records.

That code destroy should probably be put behind an option that is default on so that ActionText can disable it. I probably tried a bit too hard to keep things clean after bad experiences with Globalize...

from mobility-actiontext.

sedubois avatar sedubois commented on May 20, 2024

Fixed by #12.

from mobility-actiontext.

Related Issues (10)

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.