Skip to content

Commit

Permalink
Merge 4bad193 into fae18a7
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoviola committed Sep 18, 2019
2 parents fae18a7 + 4bad193 commit bd047fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def search_works(search)
end

def self.search(search)
where("title LIKE ? OR slug LIKE ?", "%#{search}%", "%#{search}%")
where("title like ? OR slug LIKE ? OR owner_user_id in (select id from users where owner=1 and display_name like ?)", "%#{search}%", "%#{search}%", "%#{search}%")
end

def sections
Expand Down
2 changes: 1 addition & 1 deletion app/models/document_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def search_collection_works(search)
end

def self.search(search)
where("title LIKE ? OR slug LIKE ?", "%#{search}%", "%#{search}%")
where("title like ? OR slug LIKE ? OR owner_user_id in (select id from users where owner=1 and display_name like ?)", "%#{search}%", "%#{search}%", "%#{search}%")
end

def default_orientation
Expand Down
3 changes: 3 additions & 0 deletions app/views/dashboard/landing_page.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

.columns.project-list
article.maincol
-if @search_results
-@search_results.each do |sr|
=link_to sr.title, collection_path(current_user.slug, sr.id) unless current_user.nil?
-@owners.each do |owner|
-if params[:search]
-projects = @search_results.select{ |p| p.owner_user_id == owner.id}
Expand Down

0 comments on commit bd047fc

Please sign in to comment.