Sha256: b3d6741c4e52e5726b2ab5c1c70411a6dd05937c4d173196a8e0a58885712740

Contents?: true

Size: 1.12 KB

Versions: 62

Compression:

Stored size: 1.12 KB

Contents

module Workarea
  module Admin
    class CreateReleasesController < Admin::ApplicationController
      required_permissions :releases

      before_action :find_release

      def index
        render :setup
      end

      def create
        @release.attributes = params[:release]

        if @release.save
          flash[:success] =
            t('workarea.admin.create_releases.flash_messages.created')
          redirect_to plan_create_release_path(@release)
        else
          render :setup, status: :unprocessable_entity
        end
      end

      def edit
        render :setup
      end

      def plan
        self.current_release = @release

        search = Search::AdminReleasables.new(params)
        @search = SearchViewModel.new(
          search,
          view_model_options.merge(show_type: true)
        )
      end

      private

      def find_release
        model = if params[:id].present?
                  Release.find(params[:id])
                else
                  Release.new(params[:release])
                end

        @release = ReleaseViewModel.new(model, view_model_options)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.26 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.45 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.25 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.23 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.44 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.22 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.43 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.21 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.42 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.20 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.41 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.19 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.40 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.18 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.39 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.17 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.38 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.16 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.37 app/controllers/workarea/admin/create_releases_controller.rb