Class: Essay::AssociationFeatures::GlobalizeTranslatable
- Inherits:
-
Base
- Object
- Base
- Essay::AssociationFeatures::GlobalizeTranslatable
- Defined in:
- lib/essay-globalize/association.rb
Instance Method Summary collapse
- #top_feature ⇒ Object
-
#translation_from_key_name ⇒ Object
class Article < ActiveRecord::Base belongs_to :poster translates :poster_id end.
-
#translation_table ⇒ Object
class Article < ActiveRecord::Base belongs_to :poster translates :poster_id end.
-
#translation_table_name ⇒ Object
class Article < ActiveRecord::Base belongs_to :poster translates :poster_id end.
-
#translation_to_key_name ⇒ Object
class Article < ActiveRecord::Base belongs_to :poster translates :poster_id end.
Instance Method Details
#top_feature ⇒ Object
57 58 59 |
# File 'lib/essay-globalize/association.rb', line 57 def top_feature model_features.globalize end |
#translation_from_key_name ⇒ Object
class Article < ActiveRecord::Base
belongs_to :poster
translates :poster_id
end
Article.association_features.translation_from_key_name => :poster_id
87 88 89 |
# File 'lib/essay-globalize/association.rb', line 87 def translation_from_key_name this_association.reflection.foreign_key.to_sym end |
#translation_table ⇒ Object
class Article < ActiveRecord::Base
belongs_to :poster
translates :poster_id
end
Article.association_features.translation_table => arel table for ‘article_translations’
67 68 69 |
# File 'lib/essay-globalize/association.rb', line 67 def translation_table top_feature.association_for_translations.to.arel end |
#translation_table_name ⇒ Object
class Article < ActiveRecord::Base
belongs_to :poster
translates :poster_id
end
Article.association_features.translation_table_name => ‘article_translations’
77 78 79 |
# File 'lib/essay-globalize/association.rb', line 77 def translation_table_name translation_table.name.to_sym end |
#translation_to_key_name ⇒ Object
class Article < ActiveRecord::Base
belongs_to :poster
translates :poster_id
end
Article.association_features.translation_to_key_name => :id
97 98 99 |
# File 'lib/essay-globalize/association.rb', line 97 def translation_to_key_name top_feature.association_for_translations.from_key_name end |