Skip to content

Commit

Permalink
Minor refactoring of case statements
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed May 17, 2010
1 parent 8924538 commit f235e90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/tolk/locale.rb
Expand Up @@ -141,11 +141,11 @@ def phrases_without_translation(page = nil, options = {})
def search_phrases(query, scope, page = nil, options = {})
return [] unless query.present?

case scope
translations = case scope
when :origin
translations = Tolk::Locale.primary_locale.translations.containing_text(query)
when :target
translations = self.translations.containing_text(query)
Tolk::Locale.primary_locale.translations.containing_text(query)
else # :target
self.translations.containing_text(query)
end

phrases = Tolk::Phrase.scoped(:order => 'tolk_phrases.key ASC')
Expand Down

0 comments on commit f235e90

Please sign in to comment.