app/models/notebook.rb
# Notebooks similar to this one, filtered by permissions
Notebooks similar to this one, filtered by permissions
Notebooks similar to this one filtered by permissions
def similar_for(user, use_admin=false)
    similar = notebook_similarities
      .includes(:other_notebook)
      .joins('JOIN notebooks ON notebooks.id = notebook_similarities.other_notebook_id')
    Notebook.readable_join(similar, user, use_admin).order(score: :desc)
  end
def similar_for ( user , use_admin = false ) similar = notebook_similarities . includes ( :other_notebook ) . joins ( 'JOIN notebooks ON notebooks.id = notebook_similarities.other_notebook_id' ) Notebook . readable_join ( similar , user , use_admin ) . order ( score : :desc ) end
Notebooks similar to this one, filtered by permissions
Notebooks similar to this one filtered by permissions
user
use_admin