Class: AwesomeTranslations::Handlers::ModelHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- AwesomeTranslations::Handlers::ModelHandler
show all
- Defined in:
- lib/awesome_translations/handlers/model_handler.rb
Instance Method Summary
collapse
Methods inherited from BaseHandler
#add_translations_for_hash, #enabled?, #translations_for_hash_recursive
Instance Method Details
#translations_for_group(group) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/awesome_translations/handlers/model_handler.rb', line 13
def translations_for_group(group)
ArrayEnumerator.new do |yielder|
model_inspector = AwesomeTranslations::ModelInspector.model_classes.find { |model_inspector_i| model_inspector_i.clazz.name == group.name }
raise "No inspector by that name: #{group.name}" unless model_inspector
model_names(model_inspector).each { |translation| yielder << translation }
active_record_attributes(model_inspector).each { |translation| yielder << translation }
paperclip_attachments(model_inspector).each { |translation| yielder << translation }
relationships(model_inspector).each { |translation| yielder << translation }
monetized_attributes(model_inspector).each { |translation| yielder << translation }
globalize_attributes(model_inspector).each { |translation| yielder << translation }
end
end
|