class Essay::AssociationFeatures::GlobalizeTranslatable

Public Instance Methods

top_feature() click to toggle source
# File lib/essay-globalize/association.rb, line 57
def top_feature
  model_features.globalize
end
translation_from_key_name() click to toggle source

class Article < ActiveRecord::Base

belongs_to :poster
translates :poster_id

end

Article.association_features.translation_from_key_name => :poster_id

# File lib/essay-globalize/association.rb, line 87
def translation_from_key_name
  this_association.reflection.foreign_key.to_sym
end
translation_table() click to toggle source

class Article < ActiveRecord::Base

belongs_to :poster
translates :poster_id

end

Article.association_features.translation_table => arel table for 'article_translations'

# File lib/essay-globalize/association.rb, line 67
def translation_table
  top_feature.association_for_translations.to.arel
end
translation_table_name() click to toggle source

class Article < ActiveRecord::Base

belongs_to :poster
translates :poster_id

end

Article.association_features.translation_table_name => 'article_translations'

# File lib/essay-globalize/association.rb, line 77
def translation_table_name
  translation_table.name.to_sym
end
translation_to_key_name() click to toggle source

class Article < ActiveRecord::Base

belongs_to :poster
translates :poster_id

end

Article.association_features.translation_to_key_name => :id

# File lib/essay-globalize/association.rb, line 97
def translation_to_key_name
  top_feature.association_for_translations.from_key_name
end