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 more_like_this(user, opts={})
    page = opts[:page] || 1
    per_page = opts[:per_page] || opts[:count] || Notebook.per_page
    use_admin = opts[:use_admin].nil? ? false : opts[:use_admin]
    sunspot = Sunspot.more_like_this(self) do
      instance_eval(&Notebook.solr_permissions(user, use_admin))
      paginate page: page, per_page: per_page
    end
    sunspot.results
  end
def more_like_this ( user , opts = { } ) page = opts [ :page ] || 1 per_page = opts [ :per_page ] || opts [ :count ] || Notebook . per_page use_admin = opts [ :use_admin ] . nil? ? false : opts [ :use_admin ] sunspot = Sunspot . more_like_this ( self ) do instance_eval ( & Notebook . solr_permissions ( user , use_admin ) ) paginate page : page , per_page : per_page end sunspot . results end
Notebooks similar to this one, filtered by permissions
Notebooks similar to this one filtered by permissions
user
opts