views:

131

answers:

1
    class Site < ActiveRecord::Base
      translates :title, :content
      attr_accessor :rank
    end

How I can list only the attributes of the Site model, which work with the translates method ? (in this case, I should get an array with ['title', 'content'], without the rank attribute, because it is not translated.

+1  A: 

The translations are stored in a separate table, accessible through the association globalize_translations

So, to get those, just do a

Site.first.globalize_translations

Then you will have to filter out the non-translated columns like id, site_id, locale, created_at, updated_at the remaining ones should be the ones that you have translated.

If what you want is to get which attributes that are being translated and not the contents of it, then you can find them in the globalize_options: Site.globalize_options[:translated_attributes]

Jimmy Stenke
The second case, exactly, thanks man :)
astropanic