Comments (6)
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.
I ended up adding that record column on mobility_text_translations table, it's completely useless, but at least it works
from mobility-actiontext.
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.
I got the same problem, can you guys have a solution for this case?
from mobility-actiontext.
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.
Fixed by #12.
from mobility-actiontext.
Related Issues (10)
- Publish gem to rubygems.org HOT 3
- Ruby minimum versions HOT 1
- with_rich_text_#{name} eager loading does not work HOT 5
- Require only needed Rails frameworks at runtime HOT 1
- Rendering locale specific fields with Mobility.normalize_locale(locale) is not supported. HOT 2
- Does this gem also need mobility to be installed as well? HOT 5
- Syntax for accessing records via query HOT 1
- Marks object as dirty even if nothing was changed in RichTextTranslation fields HOT 9
- No plugin configured for these keys: type. (Mobility::Pluggable::InvalidOptionKey) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobility-actiontext.