Sha256: a00c06e4823e745f368ac4a930ce63525826e8fd17d3ba54090701037cae7a12

Contents?: true

Size: 807 Bytes

Versions: 1

Compression:

Stored size: 807 Bytes

Contents

module Federails
  module Client
    class ActivitiesController < Federails::ClientController
      before_action :authenticate_user!, only: [:feed]
      before_action :authorize_action!

      # GET /app/activities
      # GET /app/activities.json
      def index
        @activities = policy_scope(Federails::Activity, policy_scope_class: Federails::Client::ActivityPolicy::Scope).all
        @activities = @activities.where actor: Actor.find_param(params[:actor_id]) if params[:actor_id]
      end

      # GET /app/feed
      # GET /app/feed.json
      def feed
        @activities = Activity.feed_for(current_user.federails_actor)
      end

      private

      def authorize_action!
        authorize(Federails::Activity, policy_class: Federails::Client::ActivityPolicy)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
federails-0.4.0 app/controllers/federails/client/activities_controller.rb