Sha256: e07c08ba79641933ba9653f5f99faa687374fba0a860f3e7a0d2a6873e0d69f4

Contents?: true

Size: 749 Bytes

Versions: 4

Compression:

Stored size: 749 Bytes

Contents

class RepositoriesController < ApplicationController

  before_filter :profile_or_current_subject!

  def show
    respond_to do |format|
      format.html {
        collection

        render collection if request.xhr?
      }

      format.json { render :json => collection }
    end
  end

  def search
    render SocialStream::Search.search(params[:q], current_subject, mode: :repository)
  end

  private

  def collection
    @collection ||=
      ActivityObject.
        select("DISTINCT activity_objects.*").
        where(object_type: SocialStream.repository_models.map(&:to_s).map(&:classify)).
        includes(SocialStream.repository_models).
        collection(profile_subject, current_subject).
        page(params[:page])
  end
end
 

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
social_stream-2.0.0.beta2 base/app/controllers/repositories_controller.rb
social_stream-base-2.0.0.beta2 app/controllers/repositories_controller.rb
social_stream-2.0.0.beta1 base/app/controllers/repositories_controller.rb
social_stream-base-2.0.0.beta1 app/controllers/repositories_controller.rb