Sha256: 44062146eca9c8955b50f51f78010bd38214f713f1f74ddb347419012bb0b44d

Contents?: true

Size: 560 Bytes

Versions: 3

Compression:

Stored size: 560 Bytes

Contents

module ActiveManageable
  module Methods
    module Edit
      extend ActiveSupport::Concern

      included do
        include ActiveManageable::Methods::Auxiliary::Includes
        include ActiveManageable::Methods::Auxiliary::Select

        def edit(id:, options: {})
          initialize_state(options: options)

          @target = model_class
          includes(@options[:includes])
          select(@options[:select])

          @target = @target.find(id)
          authorize(record: @target)

          @target
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_manageable-0.1.2 lib/active_manageable/methods/edit.rb
active_manageable-0.1.1 lib/active_manageable/methods/edit.rb
active_manageable-0.1.0 lib/active_manageable/methods/edit.rb