Sha256: 90daa34c39a9a154acc54b81c749387e71ad4f9064b203e96b3d3ab9f0f9681b

Contents?: true

Size: 416 Bytes

Versions: 3

Compression:

Stored size: 416 Bytes

Contents

module ActiveManageable
  module Methods
    module New
      extend ActiveSupport::Concern

      included do
        include ActiveManageable::Methods::Auxiliary::ModelAttributes

        def new(attributes: {})
          initialize_state(attributes: attributes)

          @target = model_class.new(attribute_values)
          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/new.rb
active_manageable-0.1.1 lib/active_manageable/methods/new.rb
active_manageable-0.1.0 lib/active_manageable/methods/new.rb