Module: ViewModel::ActiveRecord::SingularNestedController

Extended by:
ActiveSupport::Concern
Includes:
NestedControllerBase
Included in:
Controller
Defined in:
lib/view_model/active_record/singular_nested_controller.rb

Instance Method Summary collapse

Instance Method Details

#create_associated(serialize_context: new_serialize_context, deserialize_context: new_deserialize_context, lock_owner: nil, &block) ⇒ Object



26
27
28
# File 'lib/view_model/active_record/singular_nested_controller.rb', line 26

def create_associated(serialize_context: new_serialize_context, deserialize_context: new_deserialize_context, lock_owner: nil, &block)
  write_association(serialize_context: serialize_context, deserialize_context: deserialize_context, lock_owner: lock_owner, &block)
end

#create_associated_bulk(serialize_context: new_serialize_context, deserialize_context: new_deserialize_context, &block) ⇒ Object



30
31
32
# File 'lib/view_model/active_record/singular_nested_controller.rb', line 30

def create_associated_bulk(serialize_context: new_serialize_context, deserialize_context: new_deserialize_context, &block)
  write_association_bulk(serialize_context: serialize_context, deserialize_context: deserialize_context, &block)
end

#destroy_associated(serialize_context: new_serialize_context, deserialize_context: new_deserialize_context, lock_owner: nil) ⇒ Object



34
35
36
# File 'lib/view_model/active_record/singular_nested_controller.rb', line 34

def destroy_associated(serialize_context: new_serialize_context, deserialize_context: new_deserialize_context, lock_owner: nil)
  destroy_association(false, serialize_context: serialize_context, deserialize_context: deserialize_context, lock_owner: lock_owner)
end

#show_associated(scope: nil, serialize_context: new_serialize_context, lock_owner: nil, &block) ⇒ Object



22
23
24
# File 'lib/view_model/active_record/singular_nested_controller.rb', line 22

def show_associated(scope: nil, serialize_context: new_serialize_context, lock_owner: nil, &block)
  show_association(scope: scope, serialize_context: serialize_context, lock_owner: lock_owner, &block)
end