Module: ActiveManageable::Methods::Edit

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

Instance Method Summary collapse

Instance Method Details

#edit(id:, options: {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/active_manageable/methods/edit.rb', line 11

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

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

  yield if block_given?

  @target = find_object_for_edit(id: id)
  authorize(record: @target)

  @target
end