Module: ActiveManageable::Methods::New

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_manageable/methods/new.rb

Instance Method Summary collapse

Instance Method Details

#new(attributes: {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/active_manageable/methods/new.rb', line 10

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

  @target = build_object_for_new
  authorize(record: @target)

  yield if block_given?

  @target
end