Skip to content

Commit e92df40

Browse files
authored
Merge pull request #672 from quran/fix-transliteration-not-showing
Fix transliteration not showing
2 parents 2b93e77 + 0cb6552 commit e92df40

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

app/controllers/api/qdc/resources_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def tafsirs
4141
end
4242

4343
def word_by_word_translations
44-
list = ResourceContent.eager_load(:translated_name).approved.one_word.translations.order('priority ASC')
44+
list = ResourceContent.eager_load(:translated_name).approved.one_word.translations_only.order('priority ASC')
4545

4646
@word_by_word_translations = eager_load_translated_name(list)
4747

app/controllers/api/v4/resources_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def translation_info
3131
end
3232

3333
def word_by_word_translations
34-
list = ResourceContent.eager_load(:translated_name).approved.one_word.translations.order('priority ASC')
34+
list = ResourceContent.eager_load(:translated_name).approved.one_word.translations_only.order('priority ASC')
3535

3636
@word_by_word_translations = eager_load_translated_name(list)
3737

app/finders/qdc/verse_finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def load_words(word_translation_lang, mushaf)
239239
language = Language.find_with_id_or_iso_code(word_translation_lang)
240240

241241
@results = @results.where(mushaf_words: { mushaf_id: mushaf.id })
242-
approved_word_by_word_translations = ResourceContent.approved.one_word.translations
242+
approved_word_by_word_translations = ResourceContent.approved.one_word.translations_only
243243
words_with_default_translation = @results.where(word_translations: { language_id: Language.default.id, resource_content_id: approved_word_by_word_translations })
244244

245245
if language.nil? || language.default?

app/finders/v4/verse_finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def verse_pagination_end(start, total_verses)
185185
def load_words(word_translation_lang)
186186
language = Language.find_with_id_or_iso_code(word_translation_lang)
187187

188-
approved_word_by_word_translations = ResourceContent.approved.one_word.translations
188+
approved_word_by_word_translations = ResourceContent.approved.one_word.translations_only
189189
words_with_default_translation = @results.where(word_translations: { language_id: Language.default.id })
190190

191191
if language

app/finders/verse_finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def fetch_verses_range
5252
def load_words(word_translation_lang)
5353
language = Language.find_with_id_or_iso_code(word_translation_lang)
5454

55-
approved_word_by_word_translations = ResourceContent.approved.one_word.translations
55+
approved_word_by_word_translations = ResourceContent.approved.one_word.translations_only
5656
words_with_default_translation = results.where(word_translations: { language_id: Language.default.id, resource_content_id: approved_word_by_word_translations })
5757

5858
if language

app/models/resource_content.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ResourceContent < ApplicationRecord
4444

4545
scope :translations, -> { where sub_type: [SubType::Translation, SubType::Transliteration] }
4646
scope :media, -> { where sub_type: SubType::Video }
47-
scope :translations, -> { where sub_type: SubType::Translation }
47+
scope :translations_only, -> { where sub_type: SubType::Translation }
4848
scope :tafsirs, -> { where sub_type: SubType::Tafsir }
4949
scope :chapter_info, -> { where sub_type: SubType::Info }
5050
scope :one_verse, -> { where cardinality_type: CardinalityType::OneVerse }

0 commit comments

Comments
 (0)