Sha256: f86cd87660fc812d6cb75cb120b15305736c397852a856cd56a9c2e979911870

Contents?: true

Size: 915 Bytes

Versions: 2

Compression:

Stored size: 915 Bytes

Contents

# frozen_string_literal: true

require_dependency 'distribuo/application_admin_controller'

module Distribuo
  module Admin
    module Apps
      class ReleasesController < ApplicationAdminController
        before_action :set_objects

        def new
          render :edit
        end

        def create
          authorize @release
          respond(@release.update(permitted_attributes(@release)), action: :index)
        end

        def show
          render :edit
        end

        def edit; end

        def update
          authorize @release
          respond(@release.update(permitted_attributes(@release)), action: :index)
        end

        private

        def set_objects
          @app = Distribuo::App.find(params[:app_id]) if params[:app_id]
          @release = @app.releases.find(params[:id]) if params[:id]
          @release ||= @app.releases.new
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
distribuo-0.1.16 app/controllers/distribuo/admin/apps/releases_controller.rb
distribuo-0.1.8 app/controllers/distribuo/admin/apps/releases_controller.rb