Questions tagged [mobility]

Mobility is a pluggable translation framework for Ruby.

Mobility is a ruby gem for storing and retrieving translations as attributes on a class. Storage of translations is handled by customizable "backends" which encapsulate different storage strategies, including translatable columns and model translation tables, as well as database-specific storage solutions such as jsonb and Hstore (for PostgreSQL).

85 questions
0
votes
0 answers

Mobility management function

I am not sure if it is the right community here for this question. I am looking for information on what mobility management function exactly means. ( in the context of dynamic reconfiguration of management function, organic networking,…
Aid22
  • 1
0
votes
0 answers

can't get fallbacks to work in rails + mobility

I'm having some issues with configuring the mobility gem. If a translation isn't present, I would like to get the default translation (in this case :de should fallback to :en). I built a test which should explain what I'm struggling with. I guess…
Henrik
  • 203
  • 1
  • 2
  • 9
0
votes
0 answers

Rails : Translations with mobility Adding new table to mobility backend to store Booleans (Active record)

I am trying to add a new backend table to mobility gem enter link description here. As mentioned enter link description here You need to declare a new class and a new table. Here's my migration : class CreateBooleanTranslations <…
David Geismar
  • 3,152
  • 6
  • 41
  • 80
0
votes
0 answers

Eager loading model instances using single SQL statement with Mobility table backend

Using Rails 7 and Mobility 1.2.9: # config/initializers/mobility.rb Mobility.configure do |config| config.plugins do backend :table active_record reader writer backend_reader query cache dirty presence …
0
votes
2 answers

How to use validations with mobility gem?

I'm trying to add validations to my mobility-powered application and i'm confused a little.Earlier I've used code like this I18n.available_locales.each do |locale| validates :"name_#{locale}", presence: true, uniqueness: {scope:…
Alexey Poimtsev
  • 2,845
  • 3
  • 35
  • 63
0
votes
2 answers

How to setup fixtures when using Mobility with a Key Value backend?

Got a question on how to setup fixtures for Mobility. Would be very grateful for any tips on how to get this going and would be a valuable lesson for me as well on how to tackle setting up fixtures in general. Not using any gems to setup fixtures,…
csalmeida
  • 528
  • 7
  • 26
0
votes
0 answers

Mobility i18n with includes

I'm using includes to avoid N+1 queries. However, I'm using Mobility in nested elements. This is what I've tried, but I'm getting an error: undefined method 'i18n' for #
Dan
  • 1,274
  • 2
  • 15
  • 32
0
votes
1 answer

How to upsert_all/insert_all with Mobility

I need to save a large number of posts with a translated body attribute, so I'm trying to use insert_all/upsert_all in conjunction with Mobility. Saving posts individually works just fine: Post.create({ body_en: "Hello world", body_ja:…
baka-san
  • 111
  • 2
  • 8
0
votes
1 answer

How do I handle a like query using Mobility in Rails?

The title says it all. The goal is to handle a simple search. Trying to do this in my controller, which worked with Globalize: query = "%#{query}%" docs = Doc.i18n.where(category_id: category_ids) docs = docs.where("title like ?", query) Based on…
croceldon
  • 4,511
  • 11
  • 57
  • 92
0
votes
1 answer

Rails Admin integration with Mobility gem

I'm trying to use the Mobility gem with Rails Admin. I am able to edit fields through the Rails Admin interface (like the impact_description of a Ngo model) and it correctly changes the translation tables: But the problem is, the Rails Admin…
0
votes
1 answer

Moving more than one node simultaneously in contiki-os (Mobility)

Do the lines need to be in time order? e.g. #node time(s) x y 0 1.1 50.26 139.3 1 1.1 55.26 144.3 0 1.3 60.26 153.1 1 1.3 65.26 158.1 ... I've only done single-node movement myself, but that's what I'd guess based on the error you're…
0
votes
1 answer

Avoiding double query when eager loading Active Record association?

In order to make a single DB query, I am eager loading Posts along with their translation data (using Rails 6 and Mobility (*)), but instead it yields 2 SQL queries: # app/models/post.rb class Post < ApplicationRecord extend Mobility translates…
0
votes
0 answers

Accessing Translations Tables via console

If one dumps the output of a postgresql DB, there are two tables indicated (and expected): mobility_text_translations mobility_string_translations COPY public.mobility_string_translations (id, locale, key, value, translatable_type, translatable_id,…
Jerome
  • 5,583
  • 3
  • 33
  • 76
0
votes
1 answer

rails using dirty method for tracing purposes using mobility gem

A rails controller method is attempting to pass object changes if @union.update(union_params) puts '||' puts @union.changed puts @union.changes @union.update_with_log(union_params, current_user.id) However, when this runs the console…
Jerome
  • 5,583
  • 3
  • 33
  • 76
0
votes
0 answers

Table backend translations self-destruct when set to null-sy value

Not sure if this is a bug, a feature, a missed doc or a bad config, however when I set all of the translation attributes to a null-sy value, then the translation record self-destructs. I have the table-backend Mobility setup as…
dropbeardan
  • 1,080
  • 10
  • 11