Permalink
Browse files

adicionando número do tombo e gênero na busca de mídias

  • Loading branch information...
1 parent 9c2f243 commit fefb822faaf4b897d144e39399d5bbb460b01a5e @luizfaias luizfaias committed Aug 9, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/media.rb
View
@@ -32,7 +32,7 @@ def full_code
def self.search(query, page = 1)
if query
- Media.list.includes(:media_type).includes(:genre).where('title LIKE :query or author LIKE upper(:query)', :query => "%#{query}%").paginate :page => page, :per_page => 50
+ Media.list.includes(:media_type).includes(:genre).where('title LIKE upper(:query) or author LIKE upper(:query) or code LIKE upper(:query) or genres.acronym LIKE upper(:query) or media_types.name LIKE upper(:query)', :query => "%#{query}%").paginate :page => page, :per_page => 50
else
Media.list.includes(:media_type).includes(:genre).paginate :page => page, :per_page => 50
end

0 comments on commit fefb822

Please sign in to comment.