Permalink
Browse files

Minor refactoring of case statements

  • Loading branch information...
lifo committed May 17, 2010
1 parent 8924538 commit f235e909c5aac6048312a55535c779a21df6ed28
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/models/tolk/locale.rb
@@ -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')

0 comments on commit f235e90

Please sign in to comment.