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.4.27 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.4 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.26 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.3 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.25 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.2 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.24 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.1 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.23 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.22 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.0 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.21 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.5.0.beta.1 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.20 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.19 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.18 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.17 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.16 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.15 app/controllers/workarea/admin/create_releases_controller.rb
workarea-admin-3.4.14 app/controllers/workarea/admin/create_releases_controller.rb