app/models/anime.rb
# Use this function to get the title instead of directly accessing the title.
# preference = canonical | english | romanized
Use this function to get the title instead of directly accessing the title.
preference = canonical | english | romanized
Use this function to get the title instead of directly accessing the title . preference = canonical | english | romanized
def canonical_title(preference = '')
    if preference.class == User
      preference = preference.title_language_preference
    end
    case preference
    when 'canonical'
      english_canonical && alt_title.present? ? alt_title : title
    when 'english'
      alt_title.present? ? alt_title : title
    else
      title
    end
  end
def canonical_title ( preference = '' ) if preference . class == User preference = preference . title_language_preference end case preference when 'canonical' english_canonical && alt_title . present? ? alt_title : title when 'english' alt_title . present? ? alt_title : title else title end end
Use this function to get the title instead of directly accessing the title.
Use this function to get the title instead of directly accessing the title .
preference
<not_specific>