Method: ActiveManageable::Methods::New#new

Defined in:
lib/active_manageable/methods/new.rb

#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