- Each RemoteTranslation is associated with a resource (through polymorphic) and has the locale to we want translate. - After create a RemoteTranslation we create a enqueue_remote_translation method that will be send remote translation instance to remote translation client
15 lines
330 B
Ruby
15 lines
330 B
Ruby
class RemoteTranslation < ApplicationRecord
|
|
|
|
belongs_to :remote_translatable, polymorphic: true
|
|
|
|
validates :remote_translatable_id, presence: true
|
|
validates :remote_translatable_type, presence: true
|
|
validates :locale, presence: true
|
|
|
|
after_create :enqueue_remote_translation
|
|
|
|
def enqueue_remote_translation
|
|
end
|
|
|
|
end
|